找不到localdb nuget包 [英] Unable to find localdb nuget package

查看:72
本文介绍了找不到localdb nuget包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在本地VS2103计算机上构建(F5调试)新的默认项目(Web应用程序)时,一切运行正常.

当我尝试在Visual Studio Online中构建相同的项目时,出现构建错误:

无法找到软件包"Microsoft.AspNet.Providers.LocalDB"的版本"2.0.1".

从工具NuGet.exe返回的意外退出代码1

package.config文件包含以下行:

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

当我在packages.config文件中将localdb版本更改为2.0.0时,该版本在vso上运行良好.此版本已在nuget.org上列出.

我还看到在本地vs2013计算机上,存在localdb软件包的2.0.1版本.但是,nuget.org没有列出该版本.

我如何使NuGet包括较新的2.0.1版本?或者,如何从本地vs2013机器中获取2.0.1版本以包含在vso版本中?

正如您正确指出的那样,NuGet中不存在Microsoft.AspNet.Providers.LocalDB版本2.0.1.如果您在VS2013中创建一个新应用程序并将该引用添加到packages.config,则该解决方案仍会生成,但将无法下载该包.您可以通过右键单击解决方案并选择管理NuGet软件包..."来查看此内容.顶部会显示一条横幅,表明某些依赖项无法下载.

如果您确定解决方案中需要此软件包,则解决方法是将引用更改为2.0.0.

更新

我仔细看了一下.以前我已经使用控制台应用程序对此进行了测试,但是看来您是对的-创建.NET 4.0 Web Forms项目时,会将引用添加到NuGet包Microsoft.AspNet.Providers.LocalDB版本2.0.1中.如果然后删除程序包文件夹(在解决方案文件旁边)并进行构建,则会看到我上面提到的错误,因为NuGet无法还原程序包.我猜想项目模板本身存在问题,或者出于某种原因,Microsoft从公共NuGet删除了2.0.1版本.无论哪种方式,解决方案都相同.取决于NuGet中可用的版本.

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?

解决方案

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.

这篇关于找不到localdb nuget包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆