Getting IntelliSense in Visual Studio for NuGet .nuspec filesPosted: February 19, 2011
It couldn’t be easier. First, grab the nuspec.xsd schema file from the NuGet source and copy it into your Visual Studio XML schemas folder at C:\Program Files (x86)\Microsoft Visual Studio 10.0\Xml\Schemas. Be sure to change the install location to match your machine (32-bit, 64-bit, drive letter, etc.)
Now, associate nuspec files with Visual Studio. Easiest way is to just double-click it in Windows Explorer and follow the prompts to open it with Visual Studio.
Then, you need to ensure you nuspec files have only a single XML namespace declaration, and it should be on the root <package> element. There is a bug in the currently released version of NuGet that causes this xmlns declaration to get added to the wrong element during serialization, while also adding some extra, unneeded declarations to the root element. This issue only affects IntelliSense in Visual Studio however, and is now fixed.
<br><?xml version="1.0"?><br><package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"><br><metadata><br><id>jQuery.vsdoc</id><br><title>jQuery Visual Studio 2010 IntelliSense</title><br><version>1.5</version><br><authors>Microsoft</authors><br><description>Includes vsdoc files for jQuery that provide IntelliSense in Visual Studio 2010.</description><br><summary>Includes vsdoc files for jQuery that provide IntelliSense in Visual Studio 2010.</summary><br><language>en-US</language><br><dependencies><br><dependency id="jQuery" version="1.5" /><br></dependencies><br><tags>jQuery VS IntelliSense</tags><br></metadata><br></package><br>
Once you’ve done that, you’ll get IntelliSense in VS.