MSBuild SDK that provides:
- Opinionated defaults for .NET projects
- Naming conventions
- Static analysis with Roslyn analyzers
- Set
ContinuousIntegrationBuildbased on the context - dotnet test features
- Dump on crash or hang
- Loggers when running on GitHub
- Disable Roslyn analyzers to speed up build
- Relevant NuGet packages based on the project type
To use it, create a global.json file at the solution root with the following content:
{
"sdk": {
"version": "9.0.304"
},
"msbuild-sdks": {
"Meziantou.NET.Sdk": "1.0.16",
"Meziantou.NET.Sdk.BlazorWebAssembly": "1.0.16",
"Meziantou.NET.Sdk.Razor": "1.0.16",
"Meziantou.NET.Sdk.Test": "1.0.16",
"Meziantou.NET.Sdk.Web": "1.0.16",
"Meziantou.NET.Sdk.WindowsDesktop": "1.0.16"
}
}And reference the SDK in your project file:
<Project Sdk="Meziantou.NET.Sdk">
</Project>You can the SDK by specifying the version inside the csproj file:
<Project Sdk="Meziantou.NET.Sdk/1.0.16">
</Project><Project Sdk="Microsoft.NET.SDK">
<Sdk Name="Meziantou.NET.Sdk" Version="1.0.16" />
</Project>