BulletsForHumanity.Scribe.Sdk 0.6.4

dotnet add package BulletsForHumanity.Scribe.Sdk --version 0.6.4
                    
NuGet\Install-Package BulletsForHumanity.Scribe.Sdk -Version 0.6.4
                    
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="BulletsForHumanity.Scribe.Sdk" Version="0.6.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BulletsForHumanity.Scribe.Sdk" Version="0.6.4" />
                    
Directory.Packages.props
<PackageReference Include="BulletsForHumanity.Scribe.Sdk" />
                    
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 BulletsForHumanity.Scribe.Sdk --version 0.6.4
                    
#r "nuget: BulletsForHumanity.Scribe.Sdk, 0.6.4"
                    
#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 BulletsForHumanity.Scribe.Sdk@0.6.4
                    
#: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=BulletsForHumanity.Scribe.Sdk&version=0.6.4
                    
Install as a Cake Addin
#tool nuget:?package=BulletsForHumanity.Scribe.Sdk&version=0.6.4
                    
Install as a Cake Tool

BulletsForHumanity.Scribe.Sdk

A custom MSBuild SDK that eliminates boilerplate from Roslyn analyzer and source generator projects.

Quick Start

1. Add a global.json with the SDK version:

{
  "msbuild-sdks": {
    "BulletsForHumanity.Scribe.Sdk": "0.3.0"
  }
}

2. Use the SDK in your .csproj:

<Project Sdk="BulletsForHumanity.Scribe.Sdk">
  <ItemGroup>
    <PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" />
    <PackageReference Include="BulletsForHumanity.Scribe" PrivateAssets="all" />
  </ItemGroup>
</Project>

That's it. The SDK handles everything else:

  • TargetFramework=netstandard2.0 (required by Roslyn compiler host)
  • LangVersion=14 for modern C# features
  • EnforceExtendedAnalyzerRules=true to catch common mistakes
  • Analyzer packaging (analyzers/dotnet/cs/ placement, embedded PDB)
  • Private dependency bundling (Scribe DLL alongside your analyzer)
  • Stubs.cs polyfills for init, record, required, nullable annotations
  • LocalDev multi-repo development infrastructure

What the SDK Sets

Property Default Purpose
TargetFramework netstandard2.0 Required by the Roslyn compiler host
LangVersion 14 Modern C# features with polyfill stubs
EnforceExtendedAnalyzerRules true Catches analyzer authoring mistakes
IncludeBuildOutput false DLL goes into analyzers/, not lib/
PackageType Analyzer Marks package as an analyzer
IncludeSymbols false PDB is embedded in the DLL
DebugType embedded IDE debugging support
Nullable enable Null-safety
GenerateDocumentationFile false Not needed for bundled DLLs
CopyLocalLockFileAssemblies true Enables private dependency bundling

All defaults are set in the early phase (Sdk.props) and can be overridden in your .csproj. Packaging targets (analyzer DLL placement, dependency bundling) are enforced by the SDK and cannot be overridden.

Stubs.cs Polyfills

The SDK auto-includes Stubs.cs with polyfill types for modern C# features on netstandard2.0:

  • init setters / record types (C# 9)
  • [ModuleInitializer], [SkipLocalsInit] (C# 9)
  • [CallerArgumentExpression] (C# 10)
  • Interpolated string handlers (C# 10)
  • required members (C# 11)
  • scoped ref parameters (C# 11)
  • Nullable flow analysis attributes

All polyfills are guarded by #if !NET5_0_OR_GREATER and deactivate on modern targets.

Opt out: Set <ScribeSdkIncludeStubs>false</ScribeSdkIncludeStubs> if you provide your own.

Packaging

dotnet pack produces a correct analyzer NuGet package:

  • Your analyzer DLL is placed in analyzers/dotnet/cs/
  • Private dependencies (like Scribe) are bundled alongside
  • Roslyn SDK DLLs are excluded (provided by the compiler host)

LocalDev

The SDK includes LocalDev infrastructure for multi-repo development. See the main Scribe documentation for setup instructions.

Solution-Local Analyzers

For analyzers that live inside the same solution they serve, set ScribeSolutionAnalyzer=true to auto-pack on build with automatic version management:

<Project Sdk="BulletsForHumanity.Scribe.Sdk">
  <PropertyGroup>
    <ScribeSolutionAnalyzer>true</ScribeSolutionAnalyzer>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" />
    <PackageReference Include="BulletsForHumanity.Scribe" PrivateAssets="all" />
  </ItemGroup>
</Project>

Each build produces a unique timestamp version and a version override file, using the same mechanism as LocalDev but scoped to the solution. See Solution-Local Analyzers for the complete setup guide.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

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
0.6.4 51 4/13/2026
0.6.3 53 4/13/2026
0.6.1 57 4/12/2026
0.5.3 50 4/12/2026
0.5.2 51 4/12/2026
0.5.1 50 4/12/2026
0.4.2 59 4/10/2026
0.4.1 99 4/6/2026