ICSharpCode.ReferenceAssemblyAnnotator 2.0.0-preview.7

Prefix Reserved
This is a prerelease version of ICSharpCode.ReferenceAssemblyAnnotator.
dotnet add package ICSharpCode.ReferenceAssemblyAnnotator --version 2.0.0-preview.7
                    
NuGet\Install-Package ICSharpCode.ReferenceAssemblyAnnotator -Version 2.0.0-preview.7
                    
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="ICSharpCode.ReferenceAssemblyAnnotator" Version="2.0.0-preview.7">
  <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="ICSharpCode.ReferenceAssemblyAnnotator" Version="2.0.0-preview.7" />
                    
Directory.Packages.props
<PackageReference Include="ICSharpCode.ReferenceAssemblyAnnotator">
  <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 ICSharpCode.ReferenceAssemblyAnnotator --version 2.0.0-preview.7
                    
#r "nuget: ICSharpCode.ReferenceAssemblyAnnotator, 2.0.0-preview.7"
                    
#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 ICSharpCode.ReferenceAssemblyAnnotator@2.0.0-preview.7
                    
#: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=ICSharpCode.ReferenceAssemblyAnnotator&version=2.0.0-preview.7&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=ICSharpCode.ReferenceAssemblyAnnotator&version=2.0.0-preview.7&prerelease
                    
Install as a Cake Tool

Reference Assembly Annotator

IL weaver for adding nullability annotations to .NET Framework, .NET Standard, and .NET Core reference assemblies.

Build

This is the continuation of TunnelVisionLabs.ReferenceAssemblyAnnotator, published as ICSharpCode.ReferenceAssemblyAnnotator. To migrate, replace the package ID; the MSBuild properties and items are unchanged.

Requirements

  • Build: .NET SDK 8 or newer, or Visual Studio 2022 version 17.8 or newer.

Usage

Assemblies included by default

  • .NET Framework targets
    • mscorlib
    • System
    • System.Core
    • System.Data
    • System.Drawing
    • System.IO.Compression.FileSystem
    • System.Numerics
    • System.Runtime.Serialization
    • System.Xml
    • System.Xml.Linq
  • .NET Standard targets
    • All assemblies which are defined by the .NET Standard
  • .NET Core targets before 3.0
    • All reference assemblies defined by .NET Core

.NET Core 3.0 and newer are not annotated: their reference assemblies already carry nullable annotations. Don't add the Microsoft.NETCore.App.Ref PackageDownload for those target frameworks. The SDK may download that package itself, and a second download fails restore with NU1505. When multi-targeting, condition it, for example:


<PackageDownload Include="Microsoft.NETCore.App.Ref" Version="[10.0.0]" Condition="'$(TargetFramework)' != 'net10.0'" />

Example configuration

<PropertyGroup>
  
  
  
</PropertyGroup>

<ItemGroup>
  <PackageReference Include="ICSharpCode.ReferenceAssemblyAnnotator" Version="2.0.0-preview.*" PrivateAssets="all" />

  
  <PackageDownload Include="Microsoft.NETCore.App.Ref" Version="[10.0.0]" />
</ItemGroup>

Minimal:

<ItemGroup>
  <PackageReference Include="ICSharpCode.ReferenceAssemblyAnnotator" Version="2.0.0-preview.*" PrivateAssets="all" />
  <PackageDownload Include="Microsoft.NETCore.App.Ref" Version="[10.0.0]" />
</ItemGroup>

Configuration reference

  • MSBuild properties
    • <AnnotatedReferenceAssemblyVersion>: Specifies the version of Microsoft.NETCore.App.Ref to obtain nullability information from. This is required if there are multiple PackageDownload versions of Microsoft.NETCore.App.Ref.
    • <GenerateNullableAttributes>: Set to True to include definitions of nullability attributes in the build; otherwise, False to exclude the definitions. The default value is True.
  • MSBuild items
    • <UnannotatedReferenceAssembly>: Specifies reference assemblies to annotate. This is only required for assemblies that are not automatically annotated by this package.

Releases

NuGet

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
2.0.0-preview.7 63 11/9/2026