Add a file called Directory.Build.Props
to your solution with the contents below.
<Project> <PropertyGroup> <TargetFramework>net7.0</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include="StyleCop.Analyzers" version="1.2.0-beta.435"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> </ItemGroup> </Project>
Also add a .editorconfig
to your solution to configure your code styling. The StyleCop analyzer and the .editorconfig
file play together to configure your build process.