Skip to content
IL weaver to add nullability annotations to .NET reference assemblies
C# Visual Basic
Branch: master
Clone or download
sharwell Merge pull request #56 from jnm2/optional_properties
Permit DisabledWarnings to be empty
Latest commit cdebd00 Nov 12, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
CecilBasedAnnotator Simplify package references Oct 28, 2019
TunnelVisionLabs.ReferenceAssemblyAnnotator Permit DisabledWarnings to be empty Nov 11, 2019
build
.editorconfig Use built in types consistently Sep 30, 2019
.gitattributes Add .gitignore and .gitattributes Aug 22, 2019
.gitignore Add .gitignore and .gitattributes Aug 22, 2019
CONTRIBUTING.md Add .gitignore and .gitattributes Aug 22, 2019
Directory.Build.props Update to the 16.4 compiler Oct 28, 2019
Directory.Build.targets Update to 1.0.0-alpha.53 Sep 30, 2019
LICENSE Add .gitignore and .gitattributes Aug 22, 2019
NuGet.Config Add NuGet.Config to test unpublished AppVeyor builds Sep 4, 2019
README.md
ReferenceAssemblyAnnotator.sln Add solution items for easy editing while the solution is open Oct 1, 2019
THIRD-PARTY-NOTICES.txt Add third-party notices Sep 4, 2019
TunnelVisionLabs.ReferenceAssemblyAnnotator.ruleset Add repository configuration Aug 22, 2019
appveyor.yml Add repository configuration Aug 22, 2019
codecov.yml Add repository configuration Aug 22, 2019
global.json Set rollForward=latestFeature Sep 30, 2019
stylecop.json Add repository configuration Aug 22, 2019
version.json Add repository configuration Aug 22, 2019

README.md

Reference Assembly Annotator

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

Build status

codecov

Join the chat at https://gitter.im/tunnelvisionlabs/ReferenceAssemblyAnnotator

Requirements

  • Build: C# compiler version 3.2 Beta 2 or newer (ships with Visual Studio 2019 version 16.3 Preview 2 and newer). Older versions of the compiler interpret nullable metadata differently, which can lead to incorrect build warnings.
  • Editing experience: Visual Studio 2019 version 16.3 Preview 2 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

Example configuration

<PropertyGroup>
  <!-- Specifies the version of this rewriter to use. -->
  <TunnelVisionLabsReferenceAssemblyAnnotatorVersion>1.0.0-alpha.77</TunnelVisionLabsReferenceAssemblyAnnotatorVersion>

  <!-- Specifies the version of Microsoft.NETCore.App.Ref to obtain nullability information from. -->
  <AnnotatedReferenceAssemblyVersion>3.0.0</AnnotatedReferenceAssemblyVersion>

  <!-- Includes the nullable attributes from dotnet/coreclr as source code with 'internal' accessibility. Set this to
       false if the attributes are included from another source and/or are not needed. -->
  <GenerateNullableAttributes>true</GenerateNullableAttributes>
</PropertyGroup>

<ItemGroup>
  <PackageReference Include="TunnelVisionLabs.ReferenceAssemblyAnnotator" Version="$(TunnelVisionLabsReferenceAssemblyAnnotatorVersion)" PrivateAssets="all" />
  <PackageDownload Include="Microsoft.NETCore.App.Ref" Version="[$(AnnotatedReferenceAssemblyVersion)]" />
</ItemGroup>

Minimal:

<PropertyGroup>
  <AnnotatedReferenceAssemblyVersion>3.0.0</AnnotatedReferenceAssemblyVersion>
</PropertyGroup>
<ItemGroup>
  <PackageReference Include="TunnelVisionLabs.ReferenceAssemblyAnnotator" Version="1.0.0-alpha.77" PrivateAssets="all" />
  <PackageDownload Include="Microsoft.NETCore.App.Ref" Version="[$(AnnotatedReferenceAssemblyVersion)]" />
</ItemGroup>

Configuration reference

  • MSBuild properties
    • <AnnotatedReferenceAssemblyVersion>: Specifies the version of Microsoft.NETCore.App.Ref to obtain nullability information from. There is no default value, so this must be specified by the user.
    • <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 NuGet Beta

You can’t perform that action at this time.