title: Nuget package for just content files
body: <p>I am trying to create a .NET standard nuget package of content files (with no managed assemblies), to be consumed by .NET Framework assemblies. My aim is to get this folder of files copied to the bin folder of the consuming assembly.</p>
  
  <p>This question is similar <a href="https://stackoverflow.com/q/19478775">Add native files from NuGet package to project output directory</a> (and uses this nuget package <a href="http://www.nuget.org/packages/Baseclass.Contrib.Nuget.Output/" rel="noreferrer">http://www.nuget.org/packages/Baseclass.Contrib.Nuget.Output/</a>), but I require my nuget package to be .NET Standard</p>
  
  <p>I have added the files in the assembly under contentfiles\any\any\myfiles and added the following to the metadata section of the nuspec file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;contentFiles&gt;
      &lt;files include="any/any/myfiles/*" buildAction="None" copyToOutput="true" /&gt;
  &lt;/contentFiles&gt;
  </code></pre>
  
  <p>When I try to add this to a .NET framework assembly I get the error</p>
  
  <blockquote>
    <p>Could not install package 'myPackage 1.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6.2', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.</p>
  </blockquote>
  
  <p>I have also tried adding the files to the root of the project and adding the following beneath the metadata element in the nuspec file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;files&gt;
      &lt;file src="myfiles\**\*" target="myfiles" /&gt;
  &lt;/files&gt;
  </code></pre>
  
  <p>Full nuspec file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0"?&gt;
  &lt;package&gt;
      &lt;metadata&gt;
          &lt;id&gt;myPackage&lt;/id&gt;
          &lt;version&gt;1.0.0&lt;/version&gt;
          &lt;title&gt;myPackage&lt;/title&gt;
          &lt;requireLicenseAcceptance&gt;false&lt;/requireLicenseAcceptance&gt;
          &lt;description&gt;my files/description&gt;
          &lt;releaseNotes&gt;&lt;/releaseNotes&gt;
          &lt;tags&gt;&lt;/tags&gt;
          &lt;contentFiles&gt;
              &lt;files include="any/any/myfiles/*" buildAction="None" copyToOutput="true" /&gt;
          &lt;/contentFiles&gt;
      &lt;/metadata&gt;
      &lt;files&gt;
          &lt;file src="myfiles\**\*" target="myfiles" /&gt;
      &lt;/files&gt;
  &lt;/package&gt;
  </code></pre>
  
  <p>Also, in the csproj I've also changed the TargetFramework element to:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;TargetFrameworks&gt;netstandard1.3;netstandard2.0;net40;net45;net46&lt;/TargetFrameworks&gt;
  </code></pre>
  
  <p><strong>SOLUTION:</strong></p>
  
  <p>In the end, this is the solution: "myFiles" is a folder that sits in the project root and contains many different files and sub-directories.</p>
  
  <p>nuspec file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0"?&gt;
  &lt;package &gt;
      &lt;metadata&gt;
          &lt;id&gt;myPackage&lt;/id&gt;
          &lt;version&gt;1.0.0&lt;/version&gt;
          &lt;title&gt;My Package&lt;/title&gt;
          &lt;tags&gt;&lt;/tags&gt;
          &lt;dependencies&gt;
              &lt;group targetFramework=".NETStandard2.0" /&gt;
              &lt;group targetFramework=".NETFramework4.6.2" /&gt;
          &lt;/dependencies&gt;
          &lt;contentFiles&gt;
              &lt;!-- this sets "CopyIfNewer" on all files in the project that references this package --&gt;
              &lt;files include="**/*" buildAction="None" copyToOutput="true"/&gt;
          &lt;/contentFiles&gt;
      &lt;/metadata&gt;
      &lt;files&gt;
          &lt;file src="myFiles\**\*" target="contentFiles\any\any\myFiles"/&gt;
      &lt;/files&gt;
  &lt;/package&gt;
  </code></pre>
  
  <p>The project that references the nuget package will appear to have a folder called "myfiles" (with a link icon over all the files) which will get copied to the bin folder on build.</p>