NugetPackageWatcher 0.1.1
dotnet tool install --global NugetPackageWatcher --version 0.1.1
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local NugetPackageWatcher --version 0.1.1
#tool dotnet:?package=NugetPackageWatcher&version=0.1.1
nuke :add-package NugetPackageWatcher --version 0.1.1
NugetPackageWatcher
A tool for watching changes to Nuget packages, which are then applied to the Nuget cache, streamlining the local development of Nuget packages.
What?
Nuget packages are great because they can provide a lot more functionality than standalone managed assemblies. Sadly, the development experience for developing Nuget packages is very bad. It is not easily possible to develop Nuget packages and quickly test them in another project.
For example, project A ships a Nuget package that you want to test in project B. In order to test it you will have to do the following things:
- Bump the version number of project A. This is necessary because Nuget caches packages and would use the previous build of the package.
- Build and pack project A.
- Upgrade the Nuget packages to the new version in project B. If you have a project reference wildcard the package will be upgraded automatically but only after a rebuild.
- Use the new features
Development like this is not fun, which is why I built this tool. With it the loop is shorted to:
- Build and pack project A
- Use the new features
Features
- Monitors a folder of Nuget packages and updates all assembly files
As of now only assembly files (everything under lib/
) will be transferred to the cache.
Installation
Install the global tool from Nuget:
dotnet tool install -g NugetPackageWatcher
Make sure all the Nuget packages you want to update are put into the same folder. Either by setting PackageOutputPath
or by copying the Nuget packages as part of the build.
Start monitoring the nuget packages by starting the tool in the folder with the Nuget packages:
dotnet pkgwatch
How?
The tool works by monitoring the output Nuget packages of project A and updating the cache to reflect the new changes. Because Visual Studio/MSBuild uses this cache folder directly changes are applied instantly.
This is kind of a hack and should only be used for local development as it effectively changes the integrity of a Nuget package. So only use this tool with an unpublished Nuget package version, or make sure to clean the cache afterwards.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
This package has no dependencies.