Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intellisense not recognizes extension methods for generic classes from .NET Standard 2.0 references #73302

Open
vsfeedback opened this issue May 2, 2024 · 1 comment

Comments

@vsfeedback
Copy link

vsfeedback commented May 2, 2024

This issue has been moved from a ticket on Developer Community.


[severity:It’s more difficult to complete my work]
I have a .NET Standard 2.0 Library in which I have defined this extension class.

public static class MyExtension
{
  public static void ExtendEnumerable<T>(this IEnumerable<T> items) { }

  public static void ExtendTObject<T>(this T tObject) { }
}
  

There is a second .NET 8 project which references the .NET Standard 2.0 library. From whithin the .NET 8 project Intellisense doesn’t recognize ExtendEnumerable<> when the namespace is not already imported. It does tho recognizes ExtendObject<> and it also recognizes MyExtension class and imports the using properly.
Visual Studio option Text Editor > C# > Intellisense > Show items from unimported namespaces is enabled.

I provided a little sample project which contains the same extension class defined in 3 different frameworks. While ExtendTObject<> gets recognized correctly, ExtendEnumerable<> does so only for . NET6 and . NET8 libraries. See screenshot below:

B8487abafcd354e8094e20a1ec0e7ea6b638499749695837313_Screenshot_2024-04-29_093645


Original Comments

Feedback Bot on 4/29/2024, 03:59 AM:

(private comment, text removed)


Original Solutions

(no solutions)

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels May 2, 2024
@genlu
Copy link
Member

genlu commented May 2, 2024

This might have something to do with SymbolKey

@genlu genlu added Bug IntelliSense-Completion and removed untriaged Issues and PRs which have not yet been triaged by a lead labels May 2, 2024
@genlu genlu added this to the Backlog milestone May 2, 2024
@genlu genlu self-assigned this May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants