Enabling the NuGet package restore feature is easy. Just right click on your solution inside Visual Studio and choose the 'Enable NuGet Package Restore' option.
However what if you want to disable this again? I couldn’t find an option to do this, so let’s investigate all the changes that this option made.
First it added a .nuget folder containing a nuget.targets file and nuget.exe. So we’ll start by removing this folder and all its content from your solution.
Second it added an import to this target file to all your projects that are using NuGet packages. To remove this import right click on each project and choose unload project. Right click then on the csproj file and choose the Open with… option from the context menu. Choose the XML editor to edit the file. Browse the following line and remove it from the csproj file:
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
We are not there yet. There is one other change that is done to your projects: an extra property is added called ‘RestorePackages’. So we have to remove the following line from all csproj files:
Remark: Do all these changes in one run. Otherwise Visual Studio will re-add all this information once you reload the project file.