December 08 2025
src/ Api/ Api.csproj Worker/ Worker.csproj Web/ Web.csproj tests/ Api.Tests/ Api.Tests.csproj Worker.Tests/ Worker.Tests.csproj Shared.Testing/ Shared.Testing.csproj Directory.Build.props tests/Directory.Build.props
<TargetFramework>net9.0</TargetFramework> <Nullable>enable</Nullable> <ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> <AnalysisLevel>latest</AnalysisLevel>
<Project> <!-- Shared configuration for all .NET 9 projects in the repo --> <PropertyGroup> <!-- Targeting --> <TargetFramework>net9.0</TargetFramework> <Nullable>enable</Nullable> <ImplicitUsings>enable</ImplicitUsings> <LangVersion>latest</LangVersion> <!-- Code quality --> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <AnalysisLevel>latest</AnalysisLevel> <!-- Assembly metadata --> <Company>TheCodeMan</Company> <Authors>Stefan Djokic</Authors> <RepositoryUrl>https://github.com/thecodeman/your-repo</RepositoryUrl> <RepositoryType>git</RepositoryType> <!-- Output layout --> <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath> <BaseOutputPath>artifacts\bin\</BaseOutputPath> <BaseIntermediateOutputPath>artifacts\obj\</BaseIntermediateOutputPath> </PropertyGroup> <!-- Packages shared by most projects --> <ItemGroup> <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" /> <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="9.0.0" /> </ItemGroup> </Project>
<Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <AssemblyName>MyCompany.Api</AssemblyName> </PropertyGroup> </Project>
<Project> <!-- This file is imported AFTER the root Directory.Build.props for test projects --> <PropertyGroup> <!-- Optional: tests may not treat all warnings as errors --> <TreatWarningsAsErrors>false</TreatWarningsAsErrors> <!-- Mark these assemblies as test assemblies --> <IsTestProject>true</IsTestProject> </PropertyGroup> <ItemGroup> <!-- Shared test libraries --> <PackageReference Include="xunit" Version="2.9.0" /> <PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" /> <PackageReference Include="FluentAssertions" Version="6.12.0" /> <PackageReference Include="coverlet.collector" Version="6.0.0"> <PrivateAssets>all</PrivateAssets> </PackageReference> </ItemGroup> </Project>
<Project> <PropertyGroup> <!-- Base semantic version for the whole solution --> <VersionPrefix>1.4.0</VersionPrefix> <!-- Optional manually-set suffix for prereleases --> <VersionSuffix>beta</VersionSuffix> <!-- e.g. "", "beta", "rc1" --> <!-- Assembly versions --> <AssemblyVersion>1.4.0.0</AssemblyVersion> <!-- FileVersion may include build number from CI --> <FileVersion>1.4.0.$(BuildNumber)</FileVersion> <!-- InformationalVersion is what you see in "Product version" and NuGet --> <InformationalVersion>$(VersionPrefix)-$(VersionSuffix)+build.$(BuildNumber)</InformationalVersion> </PropertyGroup> </Project>
dotnet build MySolution.sln /p:BuildNumber=123
<Project> <PropertyGroup> <!-- Enforce analyzers globally --> <AnalysisLevel>latest</AnalysisLevel> <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild> <!-- Treat all analyzer diagnostics as errors (unless overridden) --> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <!-- Example analyzer packages --> <PackageReference Include="Roslynator.Analyzers" Version="4.12.0" PrivateAssets="all" /> <PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="all" /> </ItemGroup> </Project>
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <!-- opt-out from global warnings-as-errors for this project --> <TreatWarningsAsErrors>false</TreatWarningsAsErrors> </PropertyGroup> </Project>
Directory.Build.props // global defaults src/Directory.Build.props // overrides for production code tests/Directory.Build.props // overrides for test code tools/Directory.Build.props // overrides for tiny internal utilities
<Project> <PropertyGroup> <!-- Only for production code --> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <GenerateDocumentationFile>true</GenerateDocumentationFile> <NoWarn>CS1591</NoWarn> <!-- but don't require XML docs everywhere --> </PropertyGroup> </Project>
<Project> <!-- intentionally empty to stop inheritance from parent props --> </Project>
1. Design Patterns that Deliver
This isn’t just another design patterns book. Dive into real-world examples and practical solutions to real problems in real applications.Check out it here.
Go-to resource for understanding the core concepts of design patterns without the overwhelming complexity. In this concise and affordable ebook, I've distilled the essence of design patterns into an easy-to-digest format. It is a Beginner level. Check out it here.
Every Monday morning, I share 1 actionable tip on C#, .NET & Arcitecture topic, that you can use right away.
Join 18,000+ subscribers to improve your .NET Knowledge.
Subscribe to the TheCodeMan.net and be among the 18,000+ subscribers gaining practical tips and resources to enhance your .NET expertise.