Rico Suter edited this page Jul 15, 2015 · 4 revisions

This guide shows how this extension is meant to be used.

Starting point

Open a solution which contains projects with installed NuGet packages. It's not required that the NuGet library projects are added to the solution.

1. Switch from NuGet references to Project references

Open the Tools menu and select Switch NuGet and Project references:

In the opened dialog you will see a list of all DLLs which are coming from installed NuGet packages:

Select a project file (.csproj) for each NuGet DLL you want to replace with a project reference:

Now click on Switch to Project references and the extension automatically updates your solution and projects. Additionally, it stores a file alongside each changed project to restore to the initially referenced NuGet DLLs. This file is called MyProjectName.nugetreferenceswitcher and should not be deleted, otherwise you cannot automatically revert to NuGet DLL references later.

2. Develop application and NuGet library project

Now you can develop your application as if NuGet is not used for the switched library projects.

3. Switch back to NuGet references

After development and before committing to the VCS, switch back to the original NuGet DLL references. To do so, open the Tools menu and select Switch NuGet and Project references again. Switch to the second tab and you should see the list of switches you have done previously. Now, click on the button Switch to NuGet references and the extension restores all NuGet DLL references and removes the projects from the solution if you selected this option.

4. Create new NuGet packages and upgrade application

After restoring the references, the solution most probably does not compile because the project references the original, old NuGet DLLs. You have to create new NuGet packages based on the changes in the NuGet library projects and update the projects which reference these NuGet packages. After doing that, the solution should compile again...

Tip: If you have lots of projects, you can use the Project Dependency Browser application to find projects which depend on a given NuGet package.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.