执行本地 NuGet 包安装但收到错误 - 无法获取存储库签名信息 [英] Doing a local NuGet package installation but getting the error - Unable to get repository signature information
问题描述
我正在尝试按照 Samuel Jack 的回答进行离线 NuGet 包安装:文本
I'm trying to do an offline NuGet package installation by following the answer by Samuel Jack here: Text
1.将文件添加到解决方案旁边名为 LocalPackages 的文件夹中
2.在解决方案文件旁边创建一个名为 NuGet.config 的文件
.nupkg 文件存储在本地并使用 NuGet 包管理器安装,但我收到此错误 - 无法获取源的存储库签名信息 https://api.nuget.org/v3-index/repository-signatures/5.0.0/index.json.响应状态码不表示成功:403(禁止)."
The .nupkg files are stored locally and installed using NuGet Package Manager but I'm getting this error - "Unable to get repository signature information for source https://api.nuget.org/v3-index/repository-signatures/5.0.0/index.json. Response status code does not indicate success: 403 (Forbidden)."
我不明白为什么包管理器在我尝试进行离线安装时需要从 Internet 获取存储库签名信息.我的服务器和互联网连接被阻止这就是我收到 403 错误的原因.
I don't understand why the package manager needs to get repository signature information from the internet when I'm trying to do an offline installation. Internet connection is blocked in my server & that's why I'm getting 403 error.
如何在本地安装 NuGet 包而不出现错误?
How do I install the NuGet packages locally without getting the error?
推荐答案
如何在本地安装 NuGet 包而不出现错误?
How do I install the NuGet packages locally without getting the error?
您可以尝试以下步骤:
解决方案
1) 请确保您在新的 Nuget.config
文件中有这些 xml 节点:
1) please make sure that you have these xml nodes in the new Nuget.config
file:
<disabledPackageSources>
<add key="xxxxx"(the source name of api.nuget.org/v3-index/repository-signatures/5.0.0/index.json) value="true" />
</disabledPackageSources>
2) 清除所有 nuget 缓存 或删除 C:\Users\xxxx\.nuget\packages<下的 packages 文件夹/代码>.
2) clean all nuget caches or delete the packages folder under C:\Users\xxxx\.nuget\packages
.
3) 如果您在解决方案中添加新的 Nuget.config
文件,它无法立即工作,需要重新启动.你应该重启VS然后打开你的项目,然后它就可以工作了.
3) If you add the new Nuget.config
file in your solution , it cannot work immediately, it needs a restart. You should restart VS and then open your project, and after that, it can work.
这篇关于执行本地 NuGet 包安装但收到错误 - 无法获取存储库签名信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!