Try to double-click the project in Solution Explorer, and enter the <UseWindowsForms> element:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
. . .
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
. . .
Save it. Then right-click the project, go to Property, and select “Windows” in Target OS field.