Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2013 ignores nuget.config

Tags:

I have a Visual Studio 2013 project that uses Nuget. I have a packages.config file in the root directory of the solution, defining the Nuget packages we want installed. I also have a nuget.config file in the root directory of the solution, defining packageSources, as well as some packageSourceCredentials. One of the package sources is a private repo for our company.

If I open a command prompt in that root directory of the solution, and type nuget restore it works fine, and is able to hit our private repos to pull in some of the custom packages we use.

But if I open the solution in Visual Studio 2013, and build it, it fails when trying to download our custom packages, because apparantly it is ignoring our nuget.config file, and thus does not know about our private nuget repo.

I could go into Tools > Options and add our private repo, but we're trying to do everything within the solution itself, so that it builds out-of-the-box with no custom configuration needed.

Why is nuget.config being ignored by VS 2013?

like image 285
Mason G. Zhwiti Avatar asked Apr 18 '14 17:04

Mason G. Zhwiti


People also ask

How do I enable NuGet package restore in Visual Studio 2013?

Restore packages manually using Visual Studio Enable package restore by choosing Tools > Options > NuGet Package Manager. Under Package Restore options, select Allow NuGet to download missing packages. In Solution Explorer, right click the solution and select Restore NuGet Packages.

Is NuGet config necessary?

If you're trying to create a NuGet package from your own code, you do not need a NuGet. config file. The NuGet. config file exists to specify package sources from which packages are installed and updated - i.e. where you consume packages from.


1 Answers

Restart Visual Studio after editing NuGet.config!

I've noticed that VS2012 doesn't pick up on changes to NuGet.config until after I restart it.

like image 198
Dave Mackersie Avatar answered Sep 29 '22 23:09

Dave Mackersie