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!

How to Install the Service Trace Viewer Tool (SvcTraceViewer.exe) to View *.svclog Files

Microsoft .NETI work with WCF services day to day, so sometimes I need to check the service logs to debug an issue or provide a stack trace for a bug report. To view *.svclog files, you need to install the Service Trace Viewer Tool from Microsoft.

Installing the Service Trace Viewer Tool

1) Go to the Windows SDK page and click Install Now
2) On the next page click Download and then run the web installer (winsdk_web.exe)
3) The default installation will install a lot of development tools, including the Service Trace Viewer Tool. But if you’re a minimalist and you’re just looking for the Service Trace Viewer Tool, just install the .NET Development Tools.

Install Service Trace Viewer

My machine required those additional reference assemblies, but your mileage may vary depending on what you’ve already installed.

Good luck debugging!

How to Fix “IsCleanMSDeployPackageNeeded” task failed unexpectedly

Microsoft .NETWhen deploying .NET projects, it’s handy to package them up using MSBuild. Recently I ran into an issue where my deployment scripts were working locally, but not on the build server (TeamCity). The error I was receiving looked like this:

C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: The
        "IsCleanMSDeployPackageNeeded" task failed unexpectedly.

The solution

It was clear to me that something was awry on the build server, but I wasn’t sure what that might be. After looking into it, I realized that packaging your .NET projects like this utilizes Microsoft’s Web Deploy library, which must be installed on the machine.

Click here to visit Microsoft’s official Web Deploy page and download the package.

This must have already been installed on my development machine because I have IIS running; since the build server doesn’t have IIS installed, it needed the package to be installed separately.

Happy coding!