NetPrints.Annotations 0.2.0

dotnet add package NetPrints.Annotations --version 0.2.0
                    
NuGet\Install-Package NetPrints.Annotations -Version 0.2.0
                    
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="NetPrints.Annotations" Version="0.2.0">
  <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="NetPrints.Annotations" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="NetPrints.Annotations">
  <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 NetPrints.Annotations --version 0.2.0
                    
#r "nuget: NetPrints.Annotations, 0.2.0"
                    
#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 NetPrints.Annotations@0.2.0
                    
#: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=NetPrints.Annotations&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=NetPrints.Annotations&version=0.2.0
                    
Install as a Cake Tool

NetPrints.Annotations

Roslyn analyzer and build target for embedding NetPrints type catalogs in your assemblies.

Annotating a library is optional. Any library works in NetPrints without annotations; the editor reads its public API directly. Use this package if you want to choose which members become nodes, customize their names and documentation, and ship that curated catalog inside your library. For a library you don't own, use the netprints catalog CLI instead to build a catalog file.

This is a developmentDependency package. Add it to your .csproj with PrivateAssets="all" so it stays out of consumers' dependency graphs:

<ItemGroup>
  <PackageReference Include="NetPrints.Annotations" Version="<version>" PrivateAssets="all" />
</ItemGroup>

The generator needs the compiler of the .NET 10 SDK (Roslyn 5.0 or later); an older compiler cannot load it. Then mark the public types and methods you want to expose with [NetPrintsType] and [NetPrintsNode] attributes. The Roslyn generator embeds the catalog as an assembly attribute, which the NetPrints editor reads automatically when a project references your assembly.

Attributes

[NetPrintsType] marks a class, struct, interface or enum for inclusion. DisplayName and Category are optional hints.

[NetPrintsNode] marks a public method for inclusion as a node. DisplayName, Category and Keywords are optional hints.

The hints are recorded in the catalog for tools that read it; the editor does not use them yet.

[NetPrintsIgnore] excludes a type or member from the catalog.

[assembly: NetPrintsCatalog("MyDependency")] embeds a separate catalog of a referenced assembly and generates an accessor for it (NetPrintsCatalogs.MyDependency), for example to register it from an extension. Its Id, Profile, Include, Exclude and AccessorName properties are described in the guide.

Example

In a project with the package reference above:

using NetPrints.Annotations;

[NetPrintsType(DisplayName = "Greeter", Category = "Greeting")]
public class GreetingService
{
    [NetPrintsNode(DisplayName = "Greet")]
    public string Greet(string name) => $"Hello, {name}!";
}

Troubleshooting

Generator diagnostics (NPC001 through NPC007) are listed in the guide.

The documentation summaries of your own catalog come from your source comments, which the compiler parses only when the project sets the GenerateDocumentationFile property to true. Without it the catalog is still embedded, but has no summaries, and the generator reports NPC007.

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.2.0 29 10/1/2026