A utility to update the local cache of the installed nuget packages, to help with quick testing of new dlls.
dotnet tool install -g update-local-nuget-cache
In the PostBuild event of your Visual Studio projects, add:
update-local-nuget-cache $(TargetPath)
It will then do the following:
- Identify the name of the package for the project
- Detect the local nuget cache folder which is C:\Users{User}.nuget\packages{PackageName}
- If it does not exist, end the process.
- Otherwise, finds the latest installed version directory
- Inside its lib folder, it will replace the DLL file (in the appropriate sub-folder)
This allows local applications that use the nuget package, to automatically get the updated DLL when they are rebuilt. This shortens the testing cycle and provides a convenient mechanism to test new versions of the package DLLs locally.