0
votes

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
Please disable package source on Nuget.config file like this: <disabledPackageSources> <add key="xxxxx"(the source name of api.nuget.org/v3-index/repository-signatures/5.0.0/index.json) value="true" /> </disabledPackageSources>. After that, clean nuget caches or delete C:\Users\xxxx\.nuget\packages. After that, close VS Instance and restart your solution so that the new Nuget.config file can works.Mr Qian
I can't thank you enough. You have solved my problem!Azizul H

1 Answers

1
votes

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.