PackIT icon indicating copy to clipboard operation
PackIT copied to clipboard

Directory.Build.props

Open Grauenwolf opened this issue 4 years ago • 1 comments

Part 1:. Add <TreatWarningsAsErrors>true into Directory.Build.props, no need to add it everywhere, rather disable it explicitly if for some weird reason you need to

Grauenwolf avatar Feb 17 '22 20:02 Grauenwolf

https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build?view=vs-2022

You can add something like this to the root of your source code folder and they will act as defaults for the csproj files:

<Project>
<PropertyGroup Label="Configure assembly names and namespaces">
<AssemblyName>Company.Division.$(MSBuildProjectName)</AssemblyName>
<RootNamespace>$(AssemblyName)</RootNamespace>
</PropertyGroup>
<PropertyGroup Label="Defaults">
<TargetFramework>net6.0</TargetFramework>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

Grauenwolf avatar Feb 17 '22 21:02 Grauenwolf