We are trying to setup CI in Visual studio environment using TFS.
Environment:
Windows 10
Microsoft Visual Studio 2017
MSVSTFS V 16.12
NuGet V 4.0
Getting below error:
https://api.nuget.org/v3/index.json:
Unable to load the service index for source https://api.nuget.org/v3/index.json.
An error occurred while sending the request.
The remote name could not be resolved: 'api.nuget.org'
Went through many links shared in the community by the developers which were of truly great help to understand the issue.
Some of my workarounds:
http://skolima.blogspot.ru/2012/07/nuget-proxy-settings.html
This explained about NuGet.config settings to be done
NuGet Behind Proxy
Very resourceful stackoverflow chain, I followed the steps of creating a NuGet.config like exactly mentioned here and my config file looked of the form:
I am behind a company's firewall and we are trying to setup CI/CD pipeline.
In TFS:
I am sure this a firewall proxy setting issue. Since I am able to access "api.nuget.org" out of the network.
Can someone suggest what is missing in NuGet.config to which i am pointing? Any other inputs free to share.
Yes, if you want to use Nuget behind Proxy, you should follow the steps in Nuget.config
Since you have post the workaround above, however still get the error info in TFS.
You should make sure you also changed the Nuget.config in your build agent/server. Win+R and enter
%appdata%\nuget to get the file location.
Try to build directly through visual studio on the server instead of through TFS. This will narrow down if the issue is related to your environment or TFS side.
Moreover, you could also Verbose Output to get more detail log info for troubleshooting: Enable Verbose Debug Mode for TFS Build vNext
We try to set up a Sonatype Nexus3 repository for our nuget packages. Because the repo should be accessable from the internet (external developers), we disabled anonymous access and configured LDAP realm (Active Directory).
The developers could login to the web UI and serch for nuget artifacts. But if they try to get packages with Visual Studio, it fails with "404" error. No credential window is shown (or something else).
nuget package explorer fails with "401" error.
How can I get Nexus3 running with Visual Studio (2013/15)?
According to your description, I create a Sonatype Nexus3 repository for our nuget packages and disabled anonymous access and configured LDAP realm. When I use Visual Studio 2013/2015, both of the credential windows is shown. After entering the credential information, it list all nuget packages.
The “404” error means not found. If I modify the repository url from Tools -> Options -> NuGet Package Manager -> Package Source, I will get the 404 error and the credential window will not pop up. Then I will get the 401 error which means unauthorized since you don’t enter your credential information.
So please check the repository url to confirm the url is correctly. You could copy the URL to browser to verify whether it is accessible.
After updating Visual Studio to 2015 Update 2 I kept getting a "No packages found" error in NuGet Package Manager, despite browsing/searching for packages that I knew existed and which could be added from the Package Manager Console.
This is frustrating as the NuGet site clearly shows the packages are available. As a workaround I can install them via the Package Manager Console - but the GUI just shows "No packages found".
As of VS2015 Update 2 the default and only feed installed is MS-Curated "Microsoft and .NET", https://www.nuget.org/api/v2/curated-feeds/microsoftdotnet/
This feed is missing a LOT of commonly used packages.
You can resolve this by simply adding the "normal" NuGet feed with all packages:
Open Visual Studio 2015 as admin
Tools > Options
NuGet Package Manager > Package Sources
Click the green "add" icon, and add the following feed:
NuGet: https://api.nuget.org/v3/index.json
Here are the troubleshooting steps I would take when looking into this issue.
Visual Studio Settings
Make sure you are in the BROWSE section.
Click on the Package Source drop down to the right.
Make sure nuget.org is listed.
If nuget.org is not listed, add it.
Open Tools > Options (Options window will open)
Locate NuGet Package Manager > Package Sources
Under available sources, click the + icon.
Enter NuGet.org as the package name
Enter https://api.nuget.org/v3/index.json as the package source.
Click the OK button to save changes.
**IMPORTANT** Choose ALL as your package source to search all sources.
Connectivity & DNS
Make sure internet is connected
Open CMD
ping 8.8.8.8
If this does not respond your internet is not connected
ping api.nuget.org
If this does not resolve to an IP, then you have a DNS issue.
nslookup api.nuget.org 8.8.8.8
This should list the same IP address as the ping (along with some other info), If it does not then you may have a DNS issue (some local ISP DNS servers are not very good). Try changing your internet connection's DNS server to 8.8.8.8 and trying again.
Proxy Issue
Do you have Fiddler open? This can interfere with your connection to the nuget repository. Try shutting it down.
Did you set all .NET to run through a proxy? This is a common step taken in troubleshooting if you need to see all requests coming in.
Open C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config
Remove or comment out the proxy configuration
Proxy Config Section
<system.net>
<defaultProxy enabled = "true" useDefaultCredentials = "true">
<proxy autoDetect="false" bypassonlocal="false"
proxyaddress="http://127.0.0.1:8888" usesystemdefault="false" />
</defaultProxy>
</system.net>
Another reason people may end up seeing "No package found" is that the UI defaults to "Installed" packages. Simply switch to the "Browse" tab, instead of the "Installed" tab.
In my case I was looking for a prerelease and forgot to check Include prerelease
I have created a new feed with in Package Release hub (VSTS), installed the credentials, then added the package source.
Now, I am using Visual Studio 2015 to install Micrososft.Aspnet.mvc to a project, however it gives the following error:
Exception 'System.AggregateException' thrown when trying to add source
'https://mysite.pkgs.visualstudio.com/DefaultCollection/_packaging/MyLogUtils/nuget/v3/index.json'.
Please verify all your online package sources are available.
I need to install NuGet packages normally, so I removed the feed from VSTS. However, the problem persists. How can this problem be resolved?
I met this issue today and fix it by following:
If you have delete the feed from VSTS, then you need to delete it from VS\Tools\Options\Nuget Package Manager\Package Sources:
If you didn't delete the feed in VSTS and want to use it, sign in with your VSTS team project account from VS upper right corner and restart VS:
This is may be an addition to the actual answer. I had to disable the check boxes as shown in below image to get the issue resolved. I think it might help to someone.
I had the same issue and I fixed issue by disabling my custom NuGet servers.
Go to Tools->Options->Nuget Package Manager and disable your custom NuGet servers
Since this is the first Page I hit with my Problem:
If you get the error for nuget.org site, increase Version number:
https://api.nuget.org/v3/index.json -> https://api.nuget.org/v4/index.json
under Tools->Options->Nuget Package Manager (see Image from #Eddie-MSFT)
V3 doesn't seem to work since today.
I also encountered that issue. I solved it by manually saving the index.json file and adding a local packaged source.
I had same issue, I resolved it by disabling its custom nuget server.
This exception might get when NuGet.Config file is readonly, for me unchecking the reaonly property of that file worked, generally, Nuget.config file exists in your project under .nuget folder.
File path project dir/.nuget/NuGet.Config
You have to ensure all your configured package source servers are available. Otherwise simply Go to Tools->Options->Nuget Package Manager and disable your custom NuGet servers.
One of the following might solve your problem.
Check and uncheck the package sources and click on update button, restart visual studio.
Uncheck all the other package source and only keep the one from nuget.org and click on update button, restart visual studio.
Once your package is install redo the changes as before.
'System.AggregateException' thrown when trying to add source 'https://devops.MyCompany.com/MC/_packaging/SharedFunctionalist/nuget/v3/index.json'. Please verify all your online package sources are available. One or more errors occurred.
Unable to load the service index for source https://devops.MyCompany.com/MC/_packaging/SharedFunctionalist/nuget/v3/index.json. Response status code does not indicate success: 401 (Unauthorized).
I got the same issue today.If you have noticed that It may asked you to enter DevOps credentials.That means it's request you to login your DevOps account.
There are two options for this type issue
1.Login with DevOps account(your Team Account) with your credentials.Then you can Install Nuget packages as usual.
2.Otherwise you have to delete existing package package source(which one is shared with team)by following below steps.
`Open Visual Studio ->Tools->Options->Nuget Package Manager-> Package Sources ->select that shared package Source and Delete it
Go to Tools->Options->Nuget Package Manager->Package Sources and uncheck the online NuGet Source named nuget.org https://api.nuget.org/v3/index.json. Also make sure your offline source is checked
I had the same problem. I resolved it by removing the checkmark from Tools/Options/Nuget Package Manager/Package Sources.
For me the package provoking the error was not showing up in the list of NuGet Sources (is it a bug?).
I had to go through the CLI (terminal) and enter
nuget sources
to get the list of Nuget sources.
Once the source causing the issue was listed I could remove it (you can also disable it)
nuget sources Remove -Name "source"
Documentation here
After that, restart Visual Studio
I am setting up a NuGet server to host our packages internally. I followed the steps listed below:
https://docs.nuget.org/create/hosting-your-own-nuget-feeds
but having issues.
I have a site setup in IIS on the TFS server and can navigate to the URL successfully. I see the "You are running NuGet Server 2.8.5 but the link to view your packages doesn't show any packages. However, I can publish packages successfully from the visual studio project to the remote package path which is the normal inetpub\wwwroot etc. The packages show up in the path correctly and also show up in visual studio in manage packages menu. Anyone have an idea why they aren't showing up in the package feed URL?
I would greatly appreciate any help I could get.
Thanks,
I was having similar issues. I was able to get it working by using the full file path in packagesPath key of the web.config. I could not use a relative path.