Net4x.NuGetUtility 1.0.17

dotnet add package Net4x.NuGetUtility --version 1.0.17
                    
NuGet\Install-Package Net4x.NuGetUtility -Version 1.0.17
                    
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="Net4x.NuGetUtility" Version="1.0.17" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Net4x.NuGetUtility" Version="1.0.17" />
                    
Directory.Packages.props
<PackageReference Include="Net4x.NuGetUtility" />
                    
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 Net4x.NuGetUtility --version 1.0.17
                    
#r "nuget: Net4x.NuGetUtility, 1.0.17"
                    
#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 Net4x.NuGetUtility@1.0.17
                    
#: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=Net4x.NuGetUtility&version=1.0.17
                    
Install as a Cake Addin
#tool nuget:?package=Net4x.NuGetUtility&version=1.0.17
                    
Install as a Cake Tool

NuGetUtility

NuGetUtility is a collection of tools and libraries to simplify working with NuGet packages and Visual Studio solution/project conversions. It contains utilities for finding and manipulating solutions, analyzing build order, converting old-style csproj/solution formats, packaging and uploading NuGet packages, and a set of helper libraries.

Included projects

  • NuGetUtility � CLI tools for working with solutions and packages (targets .NET 8)
  • NugetUtility.Library � reusable helpers for NuGet operations
  • CleanCache � the Net4x.CleanCache package: what a solution references instead of Net4x.NuGetUtility once NuGetUtility has prepared it � it takes NuGetUtility's per-build hooks back out, keeps the version chain, and purges the stale packages and the NuGet cache
  • Project2015To2017.* � tools and libraries to migrate older Visual Studio projects/solutions to newer SDK-style formats
  • SolutionsLibrary � utilities for analyzing solutions, build order and moving projects
  • UploadPackages � sample/tooling for creating and uploading NuGet packages
  • asyncbridge and other helper libraries � compatibility shims used by older targets

Key features

  • Parse and analyze Visual Studio solutions and project dependencies
  • Migrate legacy csproj and .sln files toward modern SDK-style projects
  • Create and upload NuGet packages programmatically
  • Helpers for build ordering and solution manipulation

Requirements

  • .NET SDK (recommended 8.0) for building the modern projects
  • Compatible runtimes for legacy targets (some libraries target .NET Framework 4.6.1 / 4.5 and .NET Standard 2.0)

Build

From the repository root:

  1. Restore and build with the .NET SDK:

    dotnet restore dotnet build -c Release

  2. Some older projects target .NET Framework. Use Visual Studio/MSBuild if you need to build those specific targets.

Net4x.CleanCache

Net4x.NuGetUtility prepares a solution: SDK-style projects, package versions factored out into Directory.NuGet.props, project files referencing them as MSBuild properties. That preparation is durable � but the tool redoes all of it on every build of every project, which on a large solution is most of the build.

Net4x.CleanCache is what you reference once the solution is prepared. Build once with it and it:

  • removes the Net4x.NuGetUtility PackageReference and the NuGet.Utility.props/.targets imports from the project and from the Directory.Build.Props / Directory.Build.Targets beside it, deleting those files when NuGetUtility's seed is all they hold;
  • puts a single Net4x.CleanCache reference in the solution's Directory.Build.props, covering every project;
  • keeps Version = $(VersionPrefix).$(VersionSuffix) and the packaging defaults, so packages come out the same;
  • after each build removes $(PackageOutputPath)$(PackageId).*.nupkg/.snupkg � only where the wildcard is a version, so a sibling package whose id extends this one keeps its output � and after Pack deletes $(NuGetPackageRoot)$(PackageId), the copy restore extracted into the cache.

From then on the removal is skipped without launching anything, and only the two cleanups run.

<PackageReference Include="Net4x.CleanCache" Version="1.0.0" PrivateAssets="All" />

To prepare again � a new project, a package reference added with a literal version � re-add the Net4x.NuGetUtility reference and build once; the preparation runs, and CleanCache unhooks it again at the end of the same build. Switches: DontUnprepareNuGetUtility, DontCleanCache, DontPutSuffix. The executable can also be run by hand: CleanCache.exe -Delete:true "<glob or directory>" ... or CleanCache.exe -Unprepare:true -ProjectPath:"<csproj>" -SolutionPath:"<sln>".

Usage

Each tool or library typically exposes a small CLI or public API. Example CLI invocations are available in the respective project folders (see Source/ and CsprojToVs2017/ for examples). For package upload configuration review Source/NuGetUtility/ and the UploadPackages project.

Contributing

Contributions are welcome. Please open issues or pull requests with clear descriptions and targeted changes. Run tests and ensure builds succeed for the intended target frameworks.

License

This project is licensed under the Apache-2.0 license. See the LICENSE.txt file for details.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Net4x.NuGetUtility:

Package Downloads
ProjectsLibrary

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.17 92 9/20/2026
1.0.16 93 9/19/2026
1.0.15 111 9/10/2026
1.0.14 106 9/5/2026
1.0.13 138 7/30/2026
1.0.12 110 7/30/2026
1.0.10 115 7/26/2026
1.0.9 125 7/22/2026
1.0.8 317 2/2/2026
1.0.7 147 12/30/2025
1.0.6 212 12/26/2025
1.0.5 223 12/22/2025
1.0.4 151 12/13/2025
1.0.3 296 6/8/2025
1.0.2 154 5/31/2025
1.0.1 145 5/31/2025
1.0.0 271 3/31/2025