Intellisense support for NuPack in VS

Seeing the tweets around, by now most of you have already downloaded and tried out NuPack either by installing the library or creating your own NuPack package using the nuspec file. So, I’m gonna skip all the intro and jump straight to nuspec intellisense support inside Visual Studio. (will skip compiling nuspec to create the package also).

Every time you want to create a NuSpec file, you would open your favorite browser and navigate to the NuPack documentation and see the nuspec specifications. That could be a lot of hassle especially if you don’t have multi-monitor support and you have to press alt+tab. To solve this, I will show you some tips to work with Visual Studio.

Here is a sample screenshot when you open nuspec file in Visual Studio.

default nuspec editor in VS

(Notice that there is also no syntax highlighting and intellisense support.)

There is a hidden feature in Visual Studio to map certain extensions to a particular editor. Since nuspec is an xml file, we need to tell VS to map it to the xml editor.


Now when you open a nuspec file in visual studio you will get syntax highlighting support same as with other xml files.

Syntax Higlighting for nuspec

But you still don’t have any intellisense support.

There is a trick to get the intellisese in VS by using the xmlns and xsd combination.

First of all you need to get the xsd schema for nuspec at Format , save it as xsd and add that xsd to Visual Studio solution (Add Existing Item). (It can be referenced as solution item rather than a project item).

Now modify the <package> tag to add the xmlns attribute.

xmlns for nuspec

Select as the xmlns. That is it. Now you have intellisense support for nuspec files.

intellisense for nuspec

I have also created an issue at codplex to add this support, you can view it at

Incase you want to download the xsd you might want to visit my FacebookSharp library project the moment it is available in ‘nupack’ branch only. There is also a sample on using rake and albacore to create the package using ‘rake nupack’ – will work on an albacore task to create the package later on).

You can also use this same trick to support intellisense support in VS for your custom web.config section. You can check out my previous article Custom web.config Intellisense.

Like my VS theme? download it at


blog comments powered by Disqus