title: How do you add additional files to a NuGet package in Visual Studio 2017?
body: <p>I recently moved to Visual Studio 2017 Community Edition. It has 2 nice new features:</p>
  <ol>
  <li><p>You don't need to explicitly include your source files in the csproj. It does this automatically.</p>
  </li>
  <li><p>It can build NuGet packages directly.</p>
  </li>
  </ol>
  <p>I want to package up my open source <code>CodeFirstWebFramework</code> DLL as a NuGet package. As well as including the <code>DLL</code>, the package has to include a whole directory tree of other files (including .js, .tmpl, .css and .md files).</p>
  <p>How do I tell Visual Studio that I want this directory tree included in the package?</p>
  <p>From what information I have found with extensive searching, and ignoring all the out-of-date information that involves adding files to the csproj, all I could find was to place them in a <code>contentFiles</code> folder, but this does not seem to work.</p>
  <p>My project file looks like this:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;Project Sdk=&quot;Microsoft.NET.Sdk&quot;&gt;
  
    &lt;PropertyGroup&gt;
      &lt;TargetFramework&gt;net45&lt;/TargetFramework&gt;
      &lt;GeneratePackageOnBuild&gt;True&lt;/GeneratePackageOnBuild&gt;
      &lt;Authors&gt;Nikki Locke&lt;/Authors&gt;
      &lt;Company&gt;Trumphurst Ltd&lt;/Company&gt;
      &lt;Description&gt;Easy to use web server for building web apps that use sql databases generated from c# classes&lt;/Description&gt;
      &lt;Copyright&gt;2017 Trumphurst Ltd.&lt;/Copyright&gt;
      &lt;PackageProjectUrl&gt;https://github.com/nikkilocke/CodeFirstWebFramework&lt;/PackageProjectUrl&gt;
      &lt;RepositoryUrl&gt;https://github.com/nikkilocke/CodeFirstWebFramework&lt;/RepositoryUrl&gt;
      &lt;RepositoryType&gt;Github&lt;/RepositoryType&gt;
      &lt;PackageTags&gt;C# SQL Code First Web Server&lt;/PackageTags&gt;
    &lt;/PropertyGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;PackageReference Include=&quot;Markdig&quot; Version=&quot;0.12.1&quot; /&gt;
      &lt;PackageReference Include=&quot;Mono.Data.Sqlite.Portable&quot; Version=&quot;1.0.3.5&quot; /&gt;
      &lt;PackageReference Include=&quot;mustache-sharp&quot; Version=&quot;0.2.10&quot; /&gt;
      &lt;PackageReference Include=&quot;MySql.Data&quot; Version=&quot;6.9.9&quot; /&gt;
      &lt;PackageReference Include=&quot;Newtonsoft.Json&quot; Version=&quot;10.0.2&quot; /&gt;
    &lt;/ItemGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;Reference Include=&quot;System.Net&quot; /&gt;
      &lt;Reference Include=&quot;System.Web&quot; /&gt;
    &lt;/ItemGroup&gt;
  
  &lt;/Project&gt;
  </code></pre>
  <p>Wildly guessing what I might need to do from the conflicting and out-of-date information on the web, I have added the following:</p>
  <pre class="lang-xml prettyprint-override"><code>  &lt;ItemGroup&gt;
      &lt;Content Include=&quot;contentFiles/**/*.*&quot; copyToOutput=&quot;true&quot;&gt;
        &lt;IncludeInPackage&gt;true&lt;/IncludeInPackage&gt;
      &lt;/Content&gt;
    &lt;/ItemGroup&gt;
  </code></pre>
  <p>Now the <code>.nupkg</code> file has the contents of the <code>contentFiles</code> folder inside it (in two places, a <code>content</code> folder, and a <code>contentFiles</code> folder).</p>
  <p>However, when I install the package in another project, the content files do not appear, although they are listed in the <code>project.assets.json</code> file in the <code>obj</code> folder.</p>