2015-11-09 44 views
32

从源'nuget.org'检索 'bootstrap.3.3.5'的包元数据时发生错误。 ========== ==========成品nuget检索包元数据

Screenshot

凡缺陷奇怪的是现场nuget.org可能会崩溃或问题是否为本地。我在Windows上使用Visual Basic。当他希望下载实体框架包时,缺陷开始,但他不接受来自官方网站包的下载nuget。

有没有解释发生了什么?

这意味着当我使用Visual Basic来设计网站并通过asp.net web应用程序处理数据库时,当我通过附带的Visual Basic中的nuget安装包时,我遇到了错误,在前一张图片中知道我转到页面https://www.nuget.org问安装NuGet。 EXE不接受下载意图是计算机中的问题还是它公开给大家。而包检索元数据

发生

错误我注意到,在Visual Studio 2015年NuGet包管理的Visual Studio来3.1.60724.766版本(从当前3.0.60624.657)一个更新,所以我下载并安装它。同样的错误。

修复

在Visual Studio 2015年

工具菜单 - > NuGet包管理器 - >软件包管理器设置

点击软件来源

点击+号

添加如下:

N AME:类似的NuGet V2

来源:https://www.nuget.org/api/v2/

取消选中当前nuget.org所以它应该是这样的: look like

现在你应该可以安装的NuGet包

& &

每个包由其所有者授权给您。对于第三方软件包,微软不承担任何责任,也不会授予任何许可。某些软件包可能包含受其他许可证管理的依赖项。按照包源(feed)URL确定任何依赖关系。

包管理器控制台主机版本3.0.0.0

类型“获取帮助的NuGet”来查看所有可用的NuGet命令。

PM>获取帮助的NuGet 主题 about_NuGet

简短说明 提供有关的NuGet包管理器命令的信息。

详细说明 本主题描述NuGet程序包管理器命令。 NuGet是一个集成包 用于向.NET项目添加库和工具的管理工具。

The following NuGet cmdlets are included. 

    Cmdlet     Description 
    ------------------  ---------------------------------------------- 
    Find-Package   Get the set of packages available from the package source, 
          based on the package Id/keyword. This is a new command that 
          will replace Get-Package -ListAvailable. 

    Get-Package    Gets the set of installed packages. With -Updates switch, 
          gets the set of package updates available from the package source. 

    Install-Package   Installs a package and its dependencies into the project. 

    Uninstall-Package  Uninstalls a package. If other packages depend on this package, 
          the command will fail unless the –Force option is specified. 

    Update-Package   Updates a package and its dependencies to a newer version. 

    Sync-Package   Get the version of installed package from specified/default project 
          and sync the version to the rest of projects in the solution. 

    Add-BindingRedirect  Examines all assemblies within the output path for a project 
          and adds binding redirects to the application (or web) 
          configuration file where necessary. 

    Get-Project    Returns a reference to the DTE (Development Tools Environment) 
          for the specified project. If none is specifed, returns the 
          default project selected in the Package Manager Console. 

    Open-PackagePage  Open the browser pointing to ProjectUrl, LicenseUrl or 
          ReportAbuseUrl of the specified package. 

    Register-TabExpansion Registers a tab expansion for the parameters of a command. 

另请参阅 在线文档:HT TP://克邻.M icrosoft。 com/fwlink /?链路ID = 206619 查找,包装 获取-包装 安装,包装 卸载,包装 更新,包装 同步包 附加BindingRedirect 获取项目 开PackagePage 注册-TabExpansion PM>

所有这些仍然是服务不起作用

+1

欢迎来到Stack Overflow。我已经修复了您的帖子的英文问题。请检查你是否打算说。我也制作了图像内联。 –

+0

感谢Rohit对您的支持,这意味着当我使用Visual Basic设计网站并通过asp.net web应用程序处理数据库时,当我通过Visual Basic中附加的nuget安装包时,我遇到了错误,在前面的图片和知道我去的网页https://www.nuget.org问安装NuGet.exe不接受下载意图是在计算机中的问题还是它公开给大家。我希望我能成功解释这个问题。 – Sultan

回答

53

它需要两个步骤(第二个也许是可选的,但我总是喜欢干净的解决方案)

  1. 在资源管理器中打开项目所在的文件夹。 使用记事本打开packages.config。 查找并移除提及损坏的软件包名称的行。

  2. 打开您的解决方案所在的文件夹。 打开子文件夹“包”。 找到包含损坏包的文件夹并将其删除。

注意:如果删除错误的包,只是使的NuGet在Visual Studio中的“选项”恢复,并启用同时,右键单击解决方案,然后选择“恢复丢失的NuGet包”

+0

你救了我,谢谢 – Manikandan

+0

谢谢。我遇到了这个问题,在安装NuGet包之间留下一个语法错误打开的未保存文件。显然,VS并不那么宽容...... – Demonslay335

+0

非常感谢! –

6

我得到了相同的问题最近,我发现我的nuget.exe是2. *。我认为它与nuget feed v3不兼容。

所以我解决它只需将nuget.exe升级到3. *。

+2

或者,如果您已经使用NuGet 3,请通过VS中的“工具>扩展和更新”菜单对其进行更新,它应该出现在左侧的“更新”选项卡下。 – MrLore

24

我的问题是由于过期的包管理器。转到VS菜单Tools > Extensions and Updates > Updates并检查NuGet Package Manager是否没有更新。安装最新版本解决了我的问题。

PS:删除HrvojeMatić建议的软件包引用,不是通过治愈它,而是通过截断头部来治愈头痛 - 这些软件包将不再可管理。

-1

在Visual Studio中打开解决方案 - >导航到packages.config文件 1 /复制在错误控制台中看到的损坏包的包属性。从程序包元素中删除损坏的程序包属性2 /保存程序包。配置文件,然后运行nuget命令 3 /当成功时,放回包的属性

0

一般来说,在我的情况下,这是NUnit 3.8.1的问题。我降级到早期版本的NUnit,问题就消失了。我没有时间调查原因。