在.Net内核中添加System.Windows.forms的引用
因此,我不得不将这一行添加到我的项目文件中:
<UseWindowsForms>true</UseWindowsForms>
比较完整的是:
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<ApplicationIcon>Server.ico</ApplicationIcon>
<Authors>VeEX</Authors>
<Copyright>Copyright © VeEX 2022</Copyright>
<Company>VeEX</Company>
<ApplicationManifest>app.manifest</ApplicationManifest>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
<UseWindowsForms>True</UseWindowsForms>
</PropertyGroup>
网友评论