问题
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