How to Fix “Could not connect to the feed specified” with NuGet and TeamCity

When using NuGet 1.7 with TeamCity 7, I was receiving an error in the NuGet GUI when trying to connect to our NuGet feed. The error in Visual Studio looked like this:

Could not connect to the feed specified at '$the-server/app/nuget/v1/FeedService.svc'. Please verify the package
source (located in the Package Manager Settings) is valid and ensure your network connectivity.

The solution

This is a confirmed bug in NuGet 1.7, as seen in both this NuGet bug report (2066) and this TeamCity bug report (21011). To fix the problem you need to download a newer version of NuGet that contains the bug fix.

NuGet 1.8

As of this blog post NuGet 1.8 isn’t released, but it should be released soon; try updating your plugin to the latest stable version to see if your problem is resolved.

Update: NuGet 1.8 has been released! Upgrade using the Visual Studio Extension Manager or download it here!

Nightly builds

If the latest stable build doesn’t resolve your issue, you can download a nightly build from NuGet’s CI server.
1. Go to NuGet’s CI server
2. Click the link at the bottom to log in as a guest
3. Under the NuGet section you’ll see a couple of options (currently 1.8 and Default)
4. Mouse over the Artifacts link for whichever build you choose (I chose to download a 1.8 build), click VisualStudioAddIn and then NuGet.Tools.vsix
5. Your download should start; let it finish
6. Probably best to close any open Visual Studio instances
7. Run the vsix installer by double-clicking it

Your new NuGet extension should now be installed and your TeamCity feed URL should now work!

Enjoy NuGetting!