.NET Core analysis PackageReference not found by analyzer
When you are analyzing a .NET Core project having PackageReference included in the project file, those Package References are not picked by analyzer.
When you deliver the application you would not get any alerts for these PackageReference (Nuget packages) because DMT does not handle these PackageReference referred in the project file but handles only the Reference referred in the project file.
.NET analyzer from 1.1 and higher version supports these PackageReference
Nuget packages are not supported at all by the DMT. They should be present with the sources as .nupkg files, because the sources location is all the analyzer knows. When you do Nuget install commands it expands the package but it copies the .nupkg file in the package folder as well or you can manually copy and paste the packages in the deploy folder anywhere. The best would be to create a "packages" folder and keep all the .nupkg files inside it. When you run the analysis the analyzer will look for the referred PackageReference in the deploy folder tree.
While running the analysis the analyzer will unzip the .nupkg files in memory and use the assemblies to resolve the objects using it in the class files.
If you do not copy paste the .nupkg files in the deploy folder you will end up with warnings like below:
When you copy paste the .nupkg file in the deploy folder you would not have any warnings in the analysis log like below:
There was some issue in .NET analyzer which failed to pick the nupkg files from the deploy folder which has been fixed in .NET 1.2.2 funcrel.
You can download it from here: https://extend.castsoftware.com/V2/packages/com.castsoftware.dotnet/1.2.2-funcrel
Please sign in to leave a comment.