Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to find localdb nuget package

when i build (F5 debug) a new default project (web application) on my local VS2103 machine everything runs fine.

when i try to build the same project in Visual Studio Online, i receive build errors:

Unable to find version '2.0.1' of package 'Microsoft.AspNet.Providers.LocalDB'.

Unexpected exit code 1 returned from tool NuGet.exe

the package.config file includes this line:

<package id="Microsoft.AspNet.Providers.LocalDB" version="2.0.1" targetFramework="net40" />

when i change the localdb version to 2.0.0 in the packages.config file, the build runs fine on vso. this version is listed on nuget.org.

i also see that on the local vs2013 machine, version 2.0.1 of the localdb package is present. however, nuget.org does not list this version.

how do i get NuGet to include the newer 2.0.1 version? Or, how do i get the 2.0.1 version from my local vs2013 machine to be included in the vso build?

like image 331
desertchief Avatar asked Jun 26 '15 21:06

desertchief


1 Answers

As you rightly point out, Microsoft.AspNet.Providers.LocalDB version 2.0.1 does not exist in NuGet. If you create a new application in VS2013 and add that reference to the packages.config, the solution will still build, but it will fail to download that package. You can see this by right clicking on the solution and selecting "Manage NuGet Packages...". There will be a banner at the top saying that some dependencies failed to download.

If you are sure that you need this package in your solution, then the fix is to change the reference to 2.0.0.

Update

I had took a closer look at this. Previously I had tested this with a console app, but it seems you are right - when creating a .NET 4.0 Web Forms project, a reference is added to NuGet package Microsoft.AspNet.Providers.LocalDB version 2.0.1. If you then delete the packages folder (next to your solution file) and build, you will see the error I mention above since NuGet is unable to restore the package. I'm guessing there is a problem with the project template itself, or Microsoft removed version 2.0.1 from public NuGet for some reason. Either way, the solution is still the same; depend on the version that is available in NuGet.

like image 119
Matt Cole Avatar answered Oct 22 '22 04:10

Matt Cole