Doing a local NuGet package installation but getting the error - Unable to get repository signature information

元气小坏坏 提交于 2021-01-29 16:16:20

问题


I'm trying to do an offline NuGet package installation by following the answer by Samuel Jack here: Text

1. Add the files to a folder called LocalPackages next to solution

2. Create a file called NuGet.config next to solution file

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)."

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.

How do I install the NuGet packages locally without getting the error?


回答1:


How do I install the NuGet packages locally without getting the error?

You can try the following steps:

Solution

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) clean all nuget caches or delete the packages folder under C:\Users\xxxx\.nuget\packages.

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.



来源:https://stackoverflow.com/questions/61380157/doing-a-local-nuget-package-installation-but-getting-the-error-unable-to-get-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!