dotnet-nuget-authoring

Guide .NET library packaging into NuGet with SDK-style projects.

1|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/rudironsoni/dotnet-agent-harness --skill dotnet-nuget-authoring-rudironsoni
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-nuget-authoring
Source: https://github.com/rudironsoni/dotnet-agent-harness/tree/main/.rulesync/skills/dotnet-nuget-authoring
Command: npx skills add https://github.com/rudironsoni/dotnet-agent-harness --skill dotnet-nuget-authoring-rudironsoni

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill simplifies the process of creating and packaging .NET libraries as NuGet packages, ensuring they are correctly structured, versioned, and ready for distribution.

Core Features & Use Cases

  • SDK-Style Project Packaging: Configure .csproj files to include essential metadata like PackageId, Version, Description, and PackageTags.
  • Source Generator Packaging: Properly package Roslyn source generators and analyzers using the analyzers/dotnet/cs/ layout and buildTransitive properties.
  • Multi-TFM Support: Create packages that target multiple .NET frameworks (e.g., netstandard2.0, net8.0) for broader compatibility.
  • Symbol Packages & Signing: Enable symbol package generation (.snupkg) for debugging and learn about package signing options.
  • Package Validation: Implement API compatibility checks and validation to ensure package quality.

Quick Start

Configure your SDK-style .NET project to include essential NuGet package metadata such as PackageId, Version, Description, and PackageTags.

Frequently Asked Questions about dotnet-nuget-authoring

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I package a .NET library as a NuGet package using an SDK-style csproj?

To package a .NET library as a NuGet package, configure your SDK-style .csproj file with essential metadata properties like PackageId, Version, Description, and PackageTags. This structure ensures your library is correctly packaged and ready for distribution.

How do I package Roslyn source generators and analyzers in a NuGet package?

Packaging Roslyn source generators requires using the analyzers/dotnet/cs/ directory layout within your NuGet package. You must also configure buildTransitive properties to ensure the analyzers and source generators are correctly referenced by consuming projects.

Can I target multiple .NET frameworks in a single NuGet package?

You can target multiple .NET frameworks in a single NuGet package by configuring multi-TFM support in your SDK-style project. This allows you to specify multiple target frameworks like netstandard2.0 and net8.0 for broader compatibility across different .NET runtimes.

How do I generate symbol packages for .NET NuGet distribution?

Generating symbol packages involves configuring your SDK-style project to produce .snupkg files alongside your primary NuGet package. These symbol packages contain debugging information and are essential for allowing consumers to step through your library's source code.

What is the best way to validate API compatibility in a .NET NuGet package?

The best way to validate API compatibility in a .NET NuGet package is by implementing the Microsoft.DotNet.ApiCompat.Task. This validation tool checks API compatibility to ensure your package maintains quality and does not introduce breaking changes across different target frameworks.

Do I need a specific .NET SDK version to use SDK-style project packaging?

SDK-style project packaging for NuGet distribution assumes a .NET 8.0+ baseline and utilizes the NuGet client bundled with the .NET 8+ SDK. Ensuring your development environment meets this baseline is required for proper multi-TFM and source generator packaging.