WPF 重写App Main函数方法

来源:互联网 发布:淘宝联盟提现规则 编辑:程序博客网 时间:2024/06/06 01:10

在wpf设计中,若在app.cs中需要写main函数,会提示报错:
错误 CS0111 Type ‘App’ already defines a member called ‘Main’ with the same parameter types ** \obj\Debug\App.g.cs
解决办法如下。
第一步:打开项目属性,在应用程序-启动对象出选择xxx.App
这里写图片描述
第二步:点击App.xaml,在属性栏将生成操作选成 Page
这里写图片描述
第三部:点击重新生成解决方案,即可解决

0 0