Source Generator Dependencies are showing under Dependencies/Analyzers, any way of preventing this?

Terra Tkai 0 Reputation points
2023-05-22T09:02:25.6833333+00:00

When installing a Source Generator via a Nuget package all the sub-dependencies are shown inside the Analyzers list in Visual Studio (in the project that has had the Nuget package added).

This is really messy as it has 20 or so dependencies. Is there any way of just showing the DLL with the actual Source Generator in it and hiding the rest? I have targeted just that DLL in the install.ps1 but it seems to still just add them all anyway. It seems to just pick up any dll that is in the Nuget package under analyzers/dotnet/cs. Is there some other way of structuring the package so this doesn't happen? Can the sub-dependencies be put somewhere else but still be picked up at runtime?

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,619 questions
{count} votes