title: need help migrating winform to net 5
body: <p>I'm porting a winform app from net core 3.1 to net 5 and getting the following error.</p>
  <blockquote>
  <p>Severity  Code    Description Project File    Line    Suppression State
  Error NETSDK1136  The target platform must be set to Windows (usually
  by including '-windows' in the TargetFramework property) when using
  Windows Forms or WPF, or referencing projects or packages that do
  so.   PublicOutput.core   C:\Program
  Files\dotnet\sdk\5.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets    369</p>
  </blockquote>
  <p>This is the section of Microsofts.net.sdk.DefaultItems.targets that this is referring to.</p>
  <pre><code>  &lt;Target Name=&quot;_CheckForInvalidWindowsDesktopTargetingConfiguration&quot;
          BeforeTargets=&quot;_CheckForInvalidConfigurationAndPlatform&quot;
          Condition=&quot;'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(_TargetFrameworkVersionWithoutV), '5.0')) and ('$(UseWindowsForms)' == 'true' or '$(UseWPF)' == 'true')&quot;&gt;
      &lt;NETSdkError Condition=&quot;'$(TargetPlatformIdentifier)' != 'Windows'&quot;
                   ResourceName=&quot;WindowsDesktopTargetPlatformMustBeWindows&quot; &gt;
  </code></pre>
  <p>I don't understand the error and the link where the error sends me is not helpful</p>
  <p><a href="https://docs.microsoft.com/en-us/visualstudio/?f1url=%3FappId%3DDev16IDEF1%26l%3DEN-US%26k%3Dk(NETSDK1136)%26rd%3Dtrue&amp;view=vs-2019" rel="noreferrer">https://docs.microsoft.com/en-us/visualstudio/?f1url=%3FappId%3DDev16IDEF1%26l%3DEN-US%26k%3Dk(NETSDK1136)%26rd%3Dtrue&amp;view=vs-2019</a></p>
  <p>I've got my target framework set to the following:</p>
  <pre><code>    &lt;TargetFramework&gt;net5.0&lt;/TargetFramework&gt;
  &lt;UseWindowsForms&gt;true&lt;/UseWindowsForms&gt;
  </code></pre>
  <p>any help would be appreciated</p>