Monthly Archives: May 2011

Creating your own NuGet server

Over the years, I have been compiling little code snippets to perform common tasks – like parsing the filename out of a file path, or adding the ever so useful .With() to the string class (supports “My {0} string {1}”.With(“awesome”, “extension”)). I often find myself opening up old projects to find the code and copying and pasting it into my new project. This leads to a lot of splintered code, and it can be a pain finding the latest version. After watching Scott Hanselman’s latest posts on NuGet, I figured it might help me keep things straight. Creating your own NuGet server is easy – however, getting it to run is a bit more complicated ­čÖé

I am not going to reinvent the wheel here, as Phil Haack has done a great job here. Some things to note:

  • You can install this in to an existing website (I added it my website using MVC3)
    • However, be aware it does add a default.aspx that you will want to delete so that people still see your old homepage
  • If you are deploying this to a server that binds multiple sites to the same ip address, make sure to add the following to your web.config
    <system.serviceModel>
    <serviceHostingEnvironment multipleSiteBindingsEnabled=true />
    </
    system.serviceModel>
    • Otherwise, you will get errors along the lines of “This collection already contains an address with scheme http”
  • Make sure to add .nupkg to your mime types on IIS (right click properties on the server in IIS MMC)
    • .nupkg application/zip should do it
    • Otherwise, you will get 400 or 404 errors when you try to request your package

Intellisense (AutoComplete) Broken in Sql Server 2008 R2

If your Intellisense in SQL Server Management Studio just stopped working, chances are you have applied Visual Studio 2010 SP1. This is because there is a compatibility issue between Microsoft SQL Server 2008 R2 Management Studio (SSMS 2008 R2) and the Transact-SQL Language Service that is included in Visual Studio 2010 SP1.

The good news is there is a fix included in the latest Cumulative Update package for SQL Server 2008 R2 –┬áhttp://support.microsoft.com/kb/2507770

All you need to do is download the pack, install it, and go back to saving your keystrokes.