2

We have a couple of internal libraries published as nuget packages and used in a couple of projects.

How should I proceed if I need to make a change in one of this libraries and test it right away without publishing a new package and updating it in the current project?

Marcelo Oliveira
  • 653
  • 5
  • 16

3 Answers3

3

I just implemented a new Visual Studio extension called NuGet Reference Switcher which can be used to switch from NuGet DLL references to project references and vice-versa automatically. This is useful for development and debugging of NuGet library projects.

https://github.com/rsuter/NuGetReferenceSwitcher

Rico Suter
  • 11,548
  • 6
  • 67
  • 93
0

The approach we use at work is that developers can build their own version of the library NuGet packages for debugging purposes. By having a local developer package respository they can use those packages for debugging / testing without having to make 'official' releases.

The local package repository can be just a directory on your machine in which you put your locally build packages. Then by updating your NuGet configuration file you can specify that NuGet should search your development directory first before searching the company wide respository.

Another approach is to build a new version of the library and then to copy the library binaries over the top of the existing binaries in the solution package directory. e.g. if you have version 2.0 of your library called MyCoolLibrary and you want to debug MyCoolApp then you could copy MyCoolLibrary.dll to the package directory of the MyCoolApp solution, over the top of of the existing version 1.5 of the MyCoolLibrary. NuGet shouldn't touch the assemblies under normal circumstances so that would work for a developer test. Note though that this won't allow you to find problems with the NuGet package if you have actually made updates there, e.g. adding new assemblies or changing strong name keys etc. etc..

Community
  • 1
  • 1
Petrik
  • 1,961
  • 13
  • 23
0

I assume you can't simply write a unit / integration test to check the expected behavior... That will be, of course, the correct way to test your library.

In that case you can simply remove the nuget reference and add a project reference to your library.

Manuel Spezzani
  • 1,041
  • 7
  • 15