NuGetizer 1.2.4

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

NuGetizer is a drop-in replacement for the .NET SDK built-in Pack (a.k.a. "SDK Pack") which instantly supercharges your ability to customize and extend the packing process in a consistent and easy to understand process designed and centered around best practices in MSBuild design and extensibility.

Yes, this means you'll never need to write a .nuspec by hand ever again, no matter how complicated or advanced your packing scenarios are.

Comprehensive and intuitive heuristics built from experience building nuget packages for over a decade make getting started with NuGetizer seamless and easy, while still accomodating the most advanced scenarios through plain MSBuild extensibility. Out of the box, NuGetizer supports:

  • Drop-in replacement for the built-in .NET SDK Pack
  • Packing project references (including transitive references)
  • Straightforward support for smart libraries packing needs
  • Packing multi-targeted projects, including framework-specific resources and dependencies
  • Fast iterative development with complementary dotnet-nugetize command line tool
  • Comprehensive diagnostic analyzers to provide guidance on packing best practices
  • Consistent and predictable naming for package content inference behaviors:
    • Pack=[true|false] ⇒ Include/exclude from package (on any item, such as PackageReference, ProjectReference, None, Content, etc.)
    • PackFolder=[folder] ⇒ Name of known folders with special behavior, such as Lib, Build, Content, Tools, etc. (as a project property or item metadata)
    • PackagePath=[path] ⇒ Package-relative path (on any item, such as None, Content, etc.)
    • Pack[Item Type]=[true|false] ⇒ Set default pack behavior for all items of a given type via simple properties (such as PackNone, PackContent, PackBuildOutput, PackDependencies, PackFrameworkReferences, PackEmbeddedResource, PackResource etc.)
  • Packaging projects using .msbuildproj and Microsoft.Build.NoTargets SDK
  • SourceLink support to populate repository information in the package
  • Automatic readme.md inclusion in the package
  • Support for content includes in readme
  • Package validation enabled by default for release multi-targeting packages.

It's strongly recommended that you install the dotnet-nugetize tool to get the best experience with NuGetizer:

dotnet tool install -g dotnet-nugetize

Given the following project:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>

    <PackageId>Quickstart</PackageId>
    <Authors>NuGetizer</Authors>
    <Description>NuGetized quickstart</Description>

    <PublishRepositoryUrl>true</PublishRepositoryUrl>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="NuGetizer" />
    <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" 
                      PrivateAssets="all" />
    <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
  </ItemGroup>

  <ItemGroup>
    <None Include="none.txt" Pack="true" />
    <Content Include="content.txt" Pack="true" />
    <Compile Update="@(Compile)" Pack="true" />
  </ItemGroup>

</Project>

Running nugetize on the project directory will produce:

nugetize quickstart

A typical packaging .msbuildproj project for a smart multi-targeted library might look like the following:

<Project Sdk="Microsoft.Build.NoTargets/3.7.0">

  <PropertyGroup>
    <PackageId>Quickstart</PackageId>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="NuGetizer" />
    <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" 
                      PrivateAssets="all" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\Analyzer\Quickstart.CodeAnalysis.csproj" />
    <ProjectReference Include="..\Build\Quickstart.Tasks.csproj" />
    <ProjectReference Include="..\Lib\Quickstart.csproj" />
    <ProjectReference Include="..\Tools\Quickstart.csproj" />
  </ItemGroup>

</Project>

And produce the following nugetize tool output:

nugetize smart library

You can open this sample and run it directly in your browser in a GitHub Codespace

Learn more about NuGetizer and its capabilities from the project documentation site.

Sponsors

Clarius Org Kirill Osenkov MFB Technologies, Inc. Torutek DRIVE.NET, Inc. Keith Pickford Thomas Bolon Kori Francis Toni Wenzel Uno Platform Dan Siegel Reuben Swartz Jacob Foshee alternate text is missing from this package README image Eric Johnson Ix Technologies B.V. David JENNI Jonathan Charley Wu Jakob Tikjøb Andersen Tino Hager Mark Seemann Ken Bonny Simon Cropp agileworks-eu sorahex Zheyu Shen Vezel ChilliCream 4OTC Vincent Limo Jordan S. Jones domischell

Sponsor this project  

Learn more about GitHub Sponsors

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 (15)

Showing the top 15 popular GitHub repositories that depend on NuGetizer:

Repository Stars
devlooped/moq
The most popular and friendly mocking framework for .NET
nissl-lab/npoi
a .NET library that can read/write Office formats without Microsoft Office installed. No COM+, no interop.
LitJSON/litjson
JSON library for the .Net framework
MonoMod/MonoMod
C# modding swiss army knife, powered by cecil.
moq/labs
The most popular and friendly mocking framework for .NET
devlooped/ThisAssembly
Exposes project and assembly level information as constants in the ThisAssembly class using source generators powered by Roslyn.
jsuarezruiz/TemplateUI
A set of Xamarin.Forms templated controls.
yoshiask/FluentStore
A unifying frontend for Windows app stores and package managers
xamarin/mqtt
Minimalist and intuitive MQTT broker and client written entirely in C#
devlooped/SmallSharp
Create, edit and run multiple C# top-level programs in the same project by just selecting the startup program from the start button.
devlooped/nugetizer
A simple to understand packing model for authoring NuGet packages
Mutagen-Modding/Synthesis
A patcher pipeline framework and GUI. Run collections of code-based mods to create content customized for your load order
dansiegel/Mobile.BuildTools
The Mobile.BuildTools makes it easier to develop code bases in a clean, consistent, secure, and configurable way. Determine at Build which environment your app needs to run on, and what Client Secrets it should have. Plus many more amazing features!
serdedotnet/serde
Serde.NET is a C# port of the popular Serde serialization library for Rust
devlooped/avatar
A modern compile-time generated interception/proxy library
Version Downloads Last updated
1.2.4 20,149 4 months ago
1.2.3 48,943 8 months ago
1.2.2 18,978 5/17/2024
1.2.1 65,652 11/30/2023
1.2.0 30,103 10/11/2023
1.1.1 10,361 8/28/2023
1.1.0 24,931 8/11/2023
0.9.2 11,726 2/11/2023
0.9.1 67,331 11/16/2022
0.9.0 38,697 9/3/2022
0.8.0 34,850 6/9/2022
0.7.5 46,503 10/13/2021
0.7.4 10,808 7/20/2021
0.7.3 447 7/19/2021
0.7.2 478 7/16/2021
0.7.1 5,408 6/17/2021
0.7.0 3,047 5/10/2021
0.6.2 25,595 3/30/2021
0.6.0 22,671 12/10/2020
0.5.0 1,839 11/25/2020
0.4.12 557 11/20/2020
0.4.11 853 11/4/2020
0.4.10 641 10/29/2020
0.4.9 2,341 10/26/2020
0.4.8 519 10/25/2020
0.4.7 913 10/21/2020
0.4.6 634 10/21/2020
0.4.5 1,120 10/8/2020
0.4.4 608 10/8/2020
0.4.3 559 10/4/2020