Better approach to testing code in NuGet packages

Following on from @CamiloTerevinto's comment, you can:

  • Use project references between your related libraries, not package references (applications and unrelated libraries can still package reference them)
  • Make your code changes, build and test
  • Once your tests pass, run a dotnet pack on your solution containing all the related libs (project references are automatically converted to package references at this point) and publish your new package versions

To avoid situations where you end up producing a different package with the same version you probably want to use something like https://github.com/dotnet/Nerdbank.GitVersioning to get deterministic versions for all your packages.