Skip to content

Commit 063a2f0

Browse files
feature: this commit introduces directory.build.props and directory.build.targets for project configuration
1 parent 1838e08 commit 063a2f0

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

Directory.Build.props

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project>
2+
<PropertyGroup>
3+
<Nullable>enable</Nullable>
4+
<ImplicitUsings>enable</ImplicitUsings>
5+
<LangVersion>latest</LangVersion>
6+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
7+
<!--
8+
Disabled CS8509 to allow switch expressions without a default case,
9+
assuming exhaustiveness is guaranteed by controlled types
10+
-->
11+
<NoWarn>$(NoWarn);CS8509</NoWarn>
12+
</PropertyGroup>
13+
</Project>

Directory.Build.targets

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<Project>
2+
<Target Name="ValidateAppSettings" BeforeTargets="Build">
3+
<Error Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true' AND !Exists('$(ProjectDir)appsettings.json')"
4+
Text="appsettings.json is required for web projects." />
5+
</Target>
6+
</Project>

0 commit comments

Comments
 (0)