【问题标题】:Nuget.org in visual studio 2015 update 2 wont get nuget packagesVisual Studio 2015 更新 2 中的 Nuget.org 不会获得 nuget 包
【发布时间】:2016-04-08 19:19:40
【问题描述】:

我有一个奇怪的错误。我无法使用 Visual Studio 2015 更新 2 下载 nuget 包。

我尝试将 nuget.org 作为包源进行广告,但它返回 404 错误

[nuget.org] V2 提要位于 'https://nuget.org/Search()?$filter=IsAbsoluteLatestVersion&searchTerm=''&targetFramework='uap10.0'&includePrerelease=true&$skip=0&$top=26' 返回了意外的状态代码“404 Not Found”。

[nuget.org] V2 提要位于 'https://nuget.org/odata/Search()?$filter=IsAbsoluteLatestVersion&searchTerm=''&targetFramework='uap10.0'&includePrerelease=true&$skip=0&$top=26' 返回了意外的状态代码“404 Not Found”。

[nuget.org] V2 提要位于 'https://nuget.org/odata/Search()?$filter=IsAbsoluteLatestVersion&searchTerm=''&targetFramework='uap10.0'&includePrerelease=true&$skip=0&$top=26' 返回了意外的状态代码“404 Not Found”。

我想安装 MVVM Light Toolkit,但无法安装,因为它在 nuget.org 上可用

有人知道解决办法吗?

【问题讨论】:

    标签: visual-studio nuget


    【解决方案1】:

    试试这个提要,这是我正在使用的:

    https://api.nuget.org/v3/index.json
    

    【讨论】:

    • 非常感谢!你救了我的命。 :-)
    【解决方案2】:

    出于某种原因,我必须先编辑我的机器范围的配置,然后才能在 Visual Studio 2015 中开始工作

    https://docs.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior#config-file-locations-and-uses

    在这个路径打开文件:%ProgramData%\NuGet\Config[\{IDE}[\{Version}[\{SKU}\]]]NuGet.Config

    并使用 SRO 建议的提要:https://api.nuget.org/v3/index.json

    这是我的特定机器配置的完整路径:`C:\ProgramData\NuGet\Config\VisualStudio\14.0\Microsoft.VisualStudio.config

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <packageSources>
        <add key="Microsoft and .NET"
             value="https://api.nuget.org/v3/index.json" />
      </packageSources>
    </configuration>
    

    【讨论】:

      【解决方案3】:

      根据 Sylvian 提到的内容,我能够通过在 Visual Studio 2017 社区版中为我的所有项目(包括 .NET Core 等)添加源代码为 https://api.nuget.org/v3/index.json 来使我的 nuget 包正常工作。所有 nuget findbypackageid 404 错误都消失了.

      【讨论】:

        猜你喜欢
        • 2018-10-22
        • 2021-05-07
        • 1970-01-01
        • 2016-09-02
        • 1970-01-01
        • 1970-01-01
        • 2019-07-15
        • 2016-12-10
        • 1970-01-01
        相关资源
        最近更新 更多