Directory.Build.props Template
Purpose
Directory.Build.props centralises build settings across projects.
Production Template
<Project>
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>14.0</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsNotAsErrors>NU1901;NU1902</WarningsNotAsErrors>
<AnalysisLevel>latest</AnalysisLevel>
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<Deterministic>true</Deterministic>
<ContinuousIntegrationBuild Condition="'$(CI)' == 'true'">true</ContinuousIntegrationBuild>
</PropertyGroup>
<PropertyGroup>
<Company>AIC</Company>
<Authors>AIC</Authors>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
</Project>Notes
Tune
WarningsNotAsErrorscarefully. Do not create a blanket escape route.Package vulnerability warning treatment should be decided by project risk appetite and security policy.
Keep project-specific settings in the project file when they do not apply globally.
Was this helpful?

