I am getting This error:
[nuget.org] Unable to load the service index for source https://api.nuget.org/v3/index.json. An error occurred while send
I was having same issue in VS 2017. You would need to enable proxy settings for VS, so that it can use existing IE proxy to reach out internet. This is especially useful, for those users, who uses office laptops and proxy settings are managed by group policies and IE settings get updated automatically. It would have been great if there was an option within VS IDE itself to add proxy just like Eclipse IDE has.
Solution
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE
Add defaultProxy tags as below, within the existing system.net tag -
<system.net>
<defaultProxy enabled="true" useDefaultCredentials="true">
<proxy usesystemdefault="true" bypassonlocal="true" />
</defaultProxy>
<settings>
<ipv6 enabled="true"/>
</settings>
</system.net>
download nupkg from https://www.nuget.org/
execute below command in cmd
dotnet new -i c:\some-folder\some-package.nupkg
Awesome Thanks to https://stackoverflow.com/a/62777292/14068039
Please go to Nuget.org and check if the Nuget is up.
I have faced the same problem with VS 2015 Go to the following folder
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
and add In my case is already present added the highlighted text
<system.net>
**<defaultProxy enabled="true" useDefaultCredentials="true">
<proxy usesystemdefault="true" bypassonlocal="true" />
</defaultProxy>**
<settings>
<ipv6 enabled="true"/>
</settings>
</system.net>
Solved my issue
TLDR ;)
FYI: the same issue is still happening for VS 2019 Version 16.6.3.
Ok, let's get started to fix this issue :)
First, you need to navigate the Visual Studio instance and for that do the following:
Open Properties on VS shortcut and then click on "Open File Location"
Edit as administrator the devenv.exe.config
with Notepad++ or other editors you prefer:
Navigate to the end of a file and check if you don't have <defaultProxy>...
section:
Make sure to add following inside <system.net>
:
<defaultProxy enabled="true" useDefaultCredentials="true">
<proxy usesystemdefault="true" bypassonlocal="true" />
</defaultProxy>
The final result should be like this:
A few notes:
devenv.exe.config
for each one..exe.config
file.Update: Btw, the same kind of approach work for many other applications, for example, check this post.
I gave up all solutions provided in Github an SO.
Checking the Manage .NET project and item templates docs I just found out that I can install a package locally.
So if anyone is struggling with this, just download .nupkg
the package from the source and use the following command
dotnet new -i c:\some-folder\some-package.nupkg