Alvecta.Build 1.0.3

dotnet add package Alvecta.Build --version 1.0.3
                    
NuGet\Install-Package Alvecta.Build -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Alvecta.Build" Version="1.0.3">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Alvecta.Build" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="Alvecta.Build">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Alvecta.Build --version 1.0.3
                    
#r "nuget: Alvecta.Build, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Alvecta.Build@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Alvecta.Build&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=Alvecta.Build&version=1.0.3
                    
Install as a Cake Tool

Alvecta.Build

Build & Test Publish package

Shared build-quality configuration for Alvecta repositories, delivered as a single NuGet package. Reference it and inherit the standard analyzer + banned-symbol + code-style setup instead of copy-pasting it into every repo's Directory.Build.props.

Package

Package NuGet
Alvecta.Build NuGet

What you get

Referencing Alvecta.Build gives every C# project in the consuming repo:

  • Analyzer packages (as transitive, dev-only dependencies — you don't list them yourself): Roslynator.Analyzers, SonarAnalyzer.CSharp, Microsoft.VisualStudio.Threading.Analyzers, ReferenceTrimmer, Microsoft.CodeAnalysis.BannedApiAnalyzers.
  • Analyzer configuration: AnalysisLevel=latest-recommended, AnalysisMode=Recommended, EnforceCodeStyleInBuild, GenerateDocumentationFile, and the shared NoWarn lists (including the test-only suppressions, applied automatically to projects whose name ends with Tests).
  • Code-style severities: the CodeStyle.globalconfig (IDExxxx → warning) and FrameworkAnalyzers.globalconfig (ASP.NET Core / EF Core / Moq severities).
  • Layered banned-symbol lists (RS0030): base + DateTime bans everywhere, plus opt-out Console and StringBuilder overlays.

Usage

With Central Package Management, add the version once in Directory.Packages.props:

<PackageVersion Include="Alvecta.Build" Version="1.0.*" />

and reference it from every project via the repo's Directory.Build.props:

<ItemGroup Condition="'$(MSBuildProjectExtension)' == '.csproj'">
  <PackageReference Include="Alvecta.Build" PrivateAssets="all" />
</ItemGroup>

That single reference replaces the analyzer PackageReferences, the GlobalAnalyzerConfigFiles, the AdditionalFiles banned-symbol wiring, and the analysis/NoWarn properties that used to be duplicated per repo.

Per-repo knobs

Property Effect
AlvectaAllowConsole=true Withholds the Console ban (for CLI / build-tooling projects).
AlvectaAllowStringBuilder=true Withholds the StringBuilder ban (for low-level string-assembly libraries).

Both default to applying the ban. Scope them per-project with a Condition on $(MSBuildProjectName), e.g.:

<PropertyGroup Condition="'$(MSBuildProjectName)' == 'Alvecta.ShopifyConnector.Deployment.Cdk'">
  <AlvectaAllowConsole>true</AlvectaAllowConsole>
</PropertyGroup>

What stays per-repo (by design)

  • Project conventions (TargetFramework, ImplicitUsings, Nullable, DisableTransitiveProjectReferences): these vary per repo.
  • The custom Alvecta.Analyzers* packages and their per-layer ApplyPrimitiveObsessionAnalyzer / ApplyValueObjectConstructionAnalyzer gating: these key off each repo's project-naming conventions, and bundling them here would create a dependency cycle for the Alvecta.Analyzers repo itself.
  • Moq + Moq.Analyzers: test tooling that lives next to the repo's other test dependencies.

Versioning

Humans own MAJOR.MINOR (in src/Packaging.props); CI owns the patch (the publish workflow stamps -p:CiBuildNumber=<run number> on every push to main). Bumping a pinned analyzer version in src/Directory.Packages.props and cutting a release updates that analyzer everywhere downstream.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 97 7/7/2026
1.0.2 158 6/30/2026
1.0.1 135 6/26/2026