Visual Studio Error: The target platform must be set to Windows

Error Description:

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.

Open .csproj file and change

<TargetFramework>net5.0</TargetFramework>

become:

<TargetFramework>net5.0-windows</TargetFramework>

Post a Comment

Previous Post Next Post