Getting IntelliSense in Visual Studio for NuGet .nuspec filesPosted: February 19, 2011 Filed under: Uncategorized 3 Comments
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.
[…] Files (x86)Microsoft Visual Studio 10.0XmlSchemas. Be sure to change the install location to… [full post] Damian Edwards Coming up blank uncategorized 0 0 0 0 […]
So your presentation about SignalR at Tech Ed, when will you write about it and upload the demo-code?
Couldn’t fins any other way to contact you.
> It couldn’t be easier.
I don’t think this means what you think it means. It would be easier, for example, if it was a part of the NuGet install and/or there was a NuGet package for it.
Thanks for the walkthrough though!