我最近已迁移到 VS 2019,现在无法通过 NuGet 安装或更新包。我收到以下错误 -
An error occurred while retrieving package metadata for 'jQuery.3.4.1' from source 'NuGet.org'.
Failed to fetch results from V2 feed at 'https://www.nuget.org/FindPackagesById()?id='jQuery'&semVerLevel=2.0.0' with following message : Response status code does not indicate success: 404 (Not Found).
Response status code does not indicate success: 404 (Not Found).
我的 NuGet 包源代码指向 --- https://api.nuget.org/v3/index.json
我应该使用其他包源吗?
最佳答案
如果您在 VS IDE 中遇到此问题:
转到 Tools=>Nuget Package Manager=>Package Manager Settings=>Package Source
检查是否有其他 URL 为 https://www.nuget.org< 的包源
,如果存在,禁用/删除此包源。
如果您在命令行中遇到此问题:
您需要像这样指定源:nuget install PackageName -Source https://api.nuget.org/v3/index.json -Version 3.4.1
。您可以使用其他安装命令(dotnet其他什么),只需确保在命令中指定正确的源即可。
希望它有助于给出正确的方向来解决问题:)
关于jquery - 无法添加或更新 NuGet 包,收到 NuGet V2 源错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59883210/