不包含适用于入口点WPF的静态“Main”方法 [英] does not contain a static 'Main' method suitable for an entry point WPF

查看:309
本文介绍了不包含适用于入口点WPF的静态“Main”方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我删除了App.xaml文件并添加了名为App.cs的新类作为入口点。

I had deleted the App.xaml file and added new class named App.cs as the entry point.

class App : Application
    {
        [STAThread()]
        static void main()
        { 

        }
    }



但是当我编译错误时显示:d:\Projects \ .... \obj\ x86 \Debug \ Test.exe不包含适用于入口点的静态Main方法。

如何解决这个问题?


But when i compile an error had shown: d:\Projects\....\obj\x86\Debug\Test.exe does not contain a static 'Main' method suitable for an entry point.
How to solve this?

推荐答案

你不应该删除它。详情请见:

http://www.wpf- tutorial.com/wpf-application/working-with-app-xaml/ [ ^ ]



如何创建新的:

http://stackoverflow.com/questions/21891288/how-to-manually-create-an-app-xaml-file-in-a-wpf-python-project-in-visual-studio [<一个href =http://stackoverflow.com/questions/21891288/how-to-manually-create-an-app-xaml-file-in-a-wpf-python-project-in-visual-studiotarget = _blanktitle =新窗口> ^ ]
You should not delete this. See details:
http://www.wpf-tutorial.com/wpf-application/working-with-app-xaml/[^]

How to create a new one:
http://stackoverflow.com/questions/21891288/how-to-manually-create-an-app-xaml-file-in-a-wpf-python-project-in-visual-studio[^]


这篇关于不包含适用于入口点WPF的静态“Main”方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆