Open vsfeedback opened 1 year ago
Note that CodeLens already supports implicit object creation, but it appears to only work for references that occur in the same project as the constructor. The above scenario to reproduce this problem occurs when the definition and reference are in different projects. I was able to reproduce the problem as listed, and also for the more specific case where both projects targeted netstandard2.0.
Please note that this isn't just "CodeLens". It also affects "Find All References".
This issue has been moved from a ticket on Developer Community.
CodeLens constructor reference not working with target-typed new
If you have a public class with a public constructor in a class library targeting netstandard2.0, CodeLens fails to accurately report any references to that constructor from any call-site using implicit (target-typed) new.
For example: In ClassLibrary1, targeting netstandard2.0:
In ClassLibrary2, targeting net6.0:
Now, back in Class1, look at the CodeLens indicators on the Class1 constructor. It shows only 1 reference when it should show 2.
Original Comments
Feedback Bot on 4/25/2023, 03:45 AM:
(private comment, text removed)
Original Solutions
(no solutions)