It can possibly detected if <PrivateAssets> or <ExcludeAssets> within <PackageReference> contains all or combination of compile; runtime; contentFiles; native
or
<packageTypes>
<packageType name="DotnetTool" /> <!-- or Template-->
</packageTypes>
What is the output of dotnet list package --include-transitive? Does it include the analyzer? If not, please consider using Version 3.0.0-alpha which uses the same machanisms as dotnet.
It can possibly detected if
<PrivateAssets>
or<ExcludeAssets>
within<PackageReference>
containsall
or combination ofcompile; runtime; contentFiles; native
orin package manifest
https://learn.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#controlling-dependency-assets https://learn.microsoft.com/en-us/nuget/create-packages/set-package-type?tabs=dotnet
i.e. https://www.nuget.org/packages/SonarAnalyzer.CSharp/ is using LGPL and it sometimes hard to fight with legal department about LGPL/GPL.