Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Working with Multiple Nuget Projects in one Solution

I have 2 projects: A & B that I want to publish as NuGet Packages but I don't know how to develop efficiently in Visual Studio.

Solution 1
   Project A
   Project B - references Project A as NuGet reference

When I make a change to Project A that is needed in Project B do I have to publish Project A? Is there a way to get the project reference functionality during development? Maybe Project B shouldn't reference Project A via NuGet?

There must be a good way to handle this situation, no? I've reviewed the NuGet docs but I couldn't find anything. There must be docs/blogs/SO posts to read more about this... I'm struggling to come up w/ the right keywords.

like image 973
spottedmahn Avatar asked Sep 12 '25 05:09

spottedmahn


2 Answers

Check out this blog post: https://markheath.net/post/multiple-nuget-single-repo

Basically, dotnet pack handles this for you automatically. You use regular project references when developing.

like image 197
Elan Hasson Avatar answered Sep 15 '25 01:09

Elan Hasson


You might want to look at this extension: NuGet Reference Switcher for Visual Studio 2017

This allows you to switch between NuGet packages and project references during development.

like image 30
Kiliman Avatar answered Sep 15 '25 02:09

Kiliman