title: dotnet build with GeneratePackageOnBuild and contentFiles
body: <p>I have a project that I'm building with <code>dotnet build -c Release /p:Platform=x86 .\Foo.csproj</code>.
  The <code>csproj</code> file is in SDK format and has this content:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;Project Sdk=&quot;Microsoft.NET.Sdk.WindowsDesktop&quot;&gt;
    &lt;PropertyGroup&gt;
      &lt;TargetFramework&gt;net48&lt;/TargetFramework&gt;
      &lt;GeneratePackageOnBuild&gt;true&lt;/GeneratePackageOnBuild&gt;
      &lt;AssemblyName&gt;Foo&lt;/AssemblyName&gt;
      &lt;Company&gt;Me&lt;/Company&gt;
      &lt;Authors&gt;Me&lt;/Authors&gt;
      &lt;Version&gt;4.12.5&lt;/Version&gt;
      &lt;AssemblyVersion&gt;4.12.5.0&lt;/AssemblyVersion&gt;
      &lt;FileVersion&gt;4.12.5.0&lt;/FileVersion&gt;
      &lt;Platforms&gt;x86&lt;/Platforms&gt;
      &lt;UseWPF&gt;true&lt;/UseWPF&gt;
    &lt;/PropertyGroup&gt;
    &lt;ItemGroup&gt;
      &lt;ProjectReference Include=&quot;..\Bar.csproj&quot;&gt;
        &lt;!-- ... --&gt;
      &lt;/ProjectReference&gt;
    &lt;/ItemGroup&gt;
    &lt;ItemGroup Label=&quot;FilesToCopy&quot;&gt;
      &lt;Content Include=&quot;..\dependent.dll&quot; Pack=&quot;true&quot; PackagePath=&quot;.\lib\net48\&quot; PackageCopyToOutput=&quot;true&quot; /&gt;
      &lt;None Include=&quot;image.jpg&quot; Pack=&quot;true&quot; PackagePath=&quot;.\contentFiles\any\any\&quot; PackageCopyToOutput=&quot;true&quot; /&gt;
    &lt;/ItemGroup&gt;
    &lt;ItemGroup&gt;
      &lt;None Update=&quot;tex_cardboard.jpg&quot;&gt;
        &lt;CopyToOutputDirectory&gt;Always&lt;/CopyToOutputDirectory&gt;
      &lt;/None&gt;
    &lt;/ItemGroup&gt;
    &lt;PropertyGroup&gt;
      &lt;TargetsForTfmSpecificBuildOutput&gt;$(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage&lt;/TargetsForTfmSpecificBuildOutput&gt;
    &lt;/PropertyGroup&gt;
    &lt;Target Name=&quot;CopyProjectReferencesToPackage&quot; DependsOnTargets=&quot;ResolveReferences&quot;&gt;
      &lt;ItemGroup&gt;
        &lt;BuildOutputInPackage Include=&quot;@(ReferenceCopyLocalPaths-&amp;gt;WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))&quot; /&gt;
      &lt;/ItemGroup&gt;
    &lt;/Target&gt;
  &lt;/Project&gt;
  </code></pre>
  <p>This will generate a nuget package on build with the <code>image.jpg</code> in a <code>contentFiles\any\any</code> folder.</p>
  <p>If I understand correctly, the the <code>.nuspec</code> file inside of the nuget package should contain:</p>
  <pre class="lang-xml prettyprint-override"><code>    &lt;contentFiles&gt;
        &lt;files include=&quot;**/*&quot; buildAction=&quot;Content&quot; /&gt;
      &lt;/contentFiles&gt;
  </code></pre>
  <p>But it does not.</p>
  <p>How do I tell, in the <code>csproj</code> file, the image file to be included as content and not to be compiled?</p>