title: How to debug using Nuget source code
body: <p>As a temporary solution (until we get an internal Symbol server setup), I am trying to build Nuget packages that include all source code for the DLL so that our users can debug its code.</p>
  
  <p>I have build the following Nuspec file </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"&gt;
      &lt;metadata&gt;
          &lt;id&gt;My Assembly&lt;/id&gt;
          &lt;version&gt;1.0.0&lt;/version&gt;
          &lt;title&gt;My Assembly&lt;/title&gt;
          &lt;authors&gt;Me&lt;/authors&gt;
          &lt;owners&gt;Me&lt;/owners&gt;
          &lt;requireLicenseAcceptance&gt;false&lt;/requireLicenseAcceptance&gt;
          &lt;description&gt;My description&lt;/description&gt;
          &lt;copyright&gt;© Me 2014&lt;/copyright&gt;
            &lt;dependencies&gt;
              &lt;dependency id="Autofac" /&gt;
              &lt;dependency id="Autofac.Configuration" /&gt;
              &lt;dependency id="Autofac.Web"/&gt;
              &lt;dependency id="AutoMapper" /&gt;
              &lt;dependency id="FluentNHibernate" /&gt;
              &lt;dependency id="Iesi.Collections"/&gt;
              &lt;dependency id="Newtonsoft.Json" /&gt;
              &lt;dependency id="NHibernate"/&gt;
          &lt;/dependencies&gt;
            &lt;frameworkAssemblies&gt;
    &lt;frameworkAssembly assemblyName="System.Web" /&gt;
  &lt;/frameworkAssemblies&gt;
      &lt;/metadata&gt;
     &lt;files&gt;
      &lt;file src="bin\MyAssembly.dll" target="lib" /&gt;
      &lt;file src="bin\MyAssembly.pdb" target="lib" /&gt;
      &lt;file src="**\*.cs" target="src"/&gt;
    &lt;/files&gt;          
  &lt;/package&gt;
  </code></pre>
  
  <p>When I add build this Nuspec file I end up with a nice package including my DLL, plus a folder called src containing the source code.</p>
  
  <p>What I can't see how to do is to get Visual Studio to use the .cs files in the src directory when debugging by referenced DLL (all I currently get is a dissembled preview). Is this possibly, I assume it should be, however I can't find any examples of how to do this.</p>
  
  <p>Edit:
  Thanks for the accepted answer. Just to note, the other way I found of doing this is to add the 'src' folder for the Nuget package in the consuming solutions Common Properties -> Debug Source Files list.</p>