is a NuGet package containing Roslyn (static code) analyzers that report issues on .NET project files.
To use the analyzers, you must include the analyzer package in your project file:
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<PackageReference Include="DotNetProjectFile.Analyzers" Version="*" PrivateAssets="all" />
</ItemGroup>
</Project>
Or via the command line:
dotnet package add DotNetProjectFile.Analyzers
The source code can be found at GitHub: github.com/dotnet-project-file-analyzers.
Issues (false positives, false negatives, etc.), and (rule) suggestions can be reported a the GibHub repository.
To fully benefit from these analyzers it is recommended to add the project file (and imported projects/props) as additional files.
To add a project file:
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<AdditionalFiles Include="*.??proj" Visible="false" />
</ItemGroup>
</Project>
To add a props file:
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ItemGroup>
<AdditionalFiles Include="../props/{file_name}" Link="Properties/{file_name}" />
</ItemGroup>
</Project>