title: NU1202: Package is not compatible with net50-windows
body: <p>I have a .NET 5 WPF application (x64) that references a user control library.
  When I reference the library directly, everything works.</p>
  <p>But when I create a Nuget package and then build the app referencing the Nuget package on my build server I get:</p>
  <blockquote>
  <p>NU1202: Package MyControls is not compatible with net50-windows  (.NETFramework,Version=v5.0,Profile=windows) / win-x64.</p>
  <p>Package MyControls supports:</p>
  <ul>
  <li>net50-windows7.0 (.NETFramework,Version=v5.0,Profile=windows7.0)</li>
  <li>netcoreapp3.1 (.NETCoreApp,Version=v3.1)</li>
  </ul>
  </blockquote>
  <p>The MyControls .csproj file contains this:</p>
  <pre><code>  &lt;PropertyGroup&gt;
      &lt;TargetFrameworks&gt;netcoreapp3.1;net5.0-windows&lt;/TargetFrameworks&gt;
      &lt;UseWPF&gt;true&lt;/UseWPF&gt;
      &lt;RuntimeIdentifiers&gt;win;win-x64&lt;/RuntimeIdentifiers&gt;
    &lt;/PropertyGroup&gt;
  </code></pre>
  <p>The app .csproj file contains this:</p>
  <pre><code> &lt;PropertyGroup&gt;
      &lt;OutputType&gt;WinExe&lt;/OutputType&gt;
      &lt;TargetFramework&gt;net5.0-windows&lt;/TargetFramework&gt;
      &lt;UseWPF&gt;true&lt;/UseWPF&gt;
      &lt;RuntimeIdentifiers&gt;win-x64&lt;/RuntimeIdentifiers&gt;
     
    &lt;/PropertyGroup&gt;
  </code></pre>
  <p>I don't understand why it outputs a package for windows 7.
  I found this link that describes it:
  <a href="https://github.com/dotnet/sdk/issues/14553" rel="nofollow noreferrer">https://github.com/dotnet/sdk/issues/14553</a>
  One of the comments in there seems to match my case:</p>
  <blockquote>
  <p>I had the same phenomenon and when I tried to install these packages
  in a .NET 5 app, it told me that &quot;net5.0&quot; and &quot;net.5.0-windows7.0&quot;
  aren't compatible. All my projects where &quot;net5.0-windows&quot; actually,
  though.</p>
  </blockquote>
  <p>If I manually copy the net5.0-windows7.0 folder to a new folder net5.0-windows under .nuget/packages, the Nuget error goes away.</p>
  <p>But instead I get this compile error:</p>
  <blockquote>
  <p>errorCS0103: The name 'Windows' does not exist in the current context</p>
  </blockquote>
  <p>What should I change to make the Nuget restore work?</p>