Using System.Windows.Forms classes in a .net core 3.0 preview9 project

后端 未结 1 1719
礼貌的吻别
礼貌的吻别 2020-12-29 23:38

How can we use classes like Screen in a .NET Core 3.0 WPF project? There are documentation pages for .NET Core 3.0 for them, so I assumed it should work.

VS and the

相关标签:
1条回答
  • 2020-12-30 00:12

    You should add <UseWindowsForms>true</UseWindowsForms> in your csproj.

    <PropertyGroup>
        <OutputType>WinExe</OutputType>
        <TargetFramework>netcoreapp3.0</TargetFramework>
        <UseWpf>true</UseWpf>
        <UseWindowsForms>true</UseWindowsForms>
    </PropertyGroup>
    
    0 讨论(0)
提交回复
热议问题