0

I reinstalled (clean) Visual Studio 2019 (Microsoft Visual Studio Community 2019 Version 16.8.5) and I get error when I try to clean solution, it complains about connection to https://api.nuget.org/v3/index.json.

When I copy paste the link to web browser I see all the packages but VS cannot reach any package.

When I rebuild I get all this error: 'obj\project.assets.json' not found. Run a NuGet package restore to generate this file.

Then I do from NuGet Console > dotnet restore and I get error:

PM> dotnet restore
  Determining projects to restore...

C:\Program Files\dotnet\sdk\5.0.103\NuGet.targets(131,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [C:\Program Files (x86)\Microsoft V
isual Studio\2019\Community\MyProjects2019\source\repos\Bank\Bank.sln]
C:\Program Files\dotnet\sdk\5.0.103\NuGet.targets(131,5): error :   The SSL connection could not be established, see inner exception. [C:\Program Files (x86)\Microsoft Visual Studio\
2019\Community\MyProjects2019\source\repos\Bank\Bank.sln]
C:\Program Files\dotnet\sdk\5.0.103\NuGet.targets(131,5): error :   The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot [C:\Program Files (x86
)\Microsoft Visual Studio\2019\Community\MyProjects2019\source\repos\Bank\Bank.sln]

PM> 

I have been trying for 4 days to resolve this problem without success, any help, any tips. Thanks

Rosdi Kasim
  • 24,267
  • 23
  • 130
  • 154
dinko
  • 19
  • 5
  • Do you happen to have any antivirus program installed? Some antivirus can cause issue with SSL. – Rosdi Kasim Feb 13 '21 at 09:07
  • No antivirus tools, I have try any solution on internet but nothing. I have only CCleaner – dinko Feb 13 '21 at 10:56
  • The clue is here: `The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot`. Are you using any proxy of some kind? Try disabling the proxy if possible, – Rosdi Kasim Feb 13 '21 at 11:34
  • no proxy, I don't use proxy – dinko Feb 13 '21 at 12:16
  • PLEASE if anyone can help, I cannot resolve this problem for last 5 days. Thanks. – dinko Feb 14 '21 at 14:34
  • Close VS, delete `C:\Users\xxx\AppData\Roaming\NuGet\NuGet.Config`, then restart vs, did it happen? Or does [this](https://stackoverflow.com/questions/46500032/unable-to-load-the-service-index-for-source-https-api-nuget-org-v3-index-json) work? – Mr Qian Feb 17 '21 at 06:50

0 Answers0