How to create NuGet package that includes XML intellisense data

tl;dr documentation files need to be .xml not .XML

I was able to get the XML files included by first enabling the production using the Build tab, checking XML Documentation File in the Output section. Note: for some reason I had to manually change the extension from .XML to lowercase .xml. YMMV. This is the same as the question you referenced, How do I create an XML Intellisense file for my DLL?.

Once done, I created the Nuspec file in the project directory. Here's a sample, you can also generate it with nuget spec MyAssembly.dll - but make sure to edit it and set the values appropriately.

<?xml version="1.0"?>
<package >
  <metadata>
    <id>$id$</id>
    <version>1.0.0</version>
    <title>Title for your package</title>
    <authors>Package Author</authors>
    <owners>Package Owner</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>A description of your library</description>
    <releaseNotes>Release notes for this version.</releaseNotes>
    <copyright>Copyright 2013</copyright>
    <tags>tag1 tag2</tags>
  </metadata>
</package>

Once that was done, I used Nuget to package. Note I had to specify the platform because I'm using a 64-bit OS, but I don't have any targets in the project for x64, only AnyCPU

nuget pack MyAssembly.csproj -Prop Configuration=Release;Platform=AnyCPU -build

The assembly and it's associated documentation were automatically included in the package. In addition any packages that you've used in your project are added to the dependency list.

See http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package for more information.


If you distribute your XML files with your NuGet package in the same folder as your Dlls then Visual Studio will then find these XML files and show IntelliSense for your assemblies.

To distribute the IntelliSense XML files you will need to add them to your .nuspec file, for example:

<files>
    <file src="bin\IronPython.dll" target="lib\Net40" />
    <file src="bin\IronPython.xml" target="lib\Net40" />
</files>