程序不包含一个静态的'主'适合入口点方法

编程入门 行业动态 更新时间:2024-10-28 16:25:29
本文介绍了程序不包含一个静态的'主'适合入口点方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我知道这个问题已经被问了很多,但没有一个解决方案,似乎为我工作。这还是我只是不称职的,需要走过这个问题(最有可能的解决方案)握着我的手。我看了看,通过所有的课程,并且所有的构建操作设置的编译,所以我不知道什么可能出了错。任何帮助?

I know that this question has been asked a lot, but none of the solutions seem to work for me. That or I am just incompetent and need to have my hand held through this problem (most likely solution). I looked through all of the classes, and all the build actions are set to compile, so I have no idea what could have gone wrong. Any help?

其他详细信息: 我一直在编写一个游戏的开始,一切都打算好,直到我得到这个错误:

Additional Details: I have been coding the starting of a game, and everything was going good until I got this error:

程序不包含一个静态的主适合的切入点方法

Program does not contain a static 'Main' method suitable for an entry point

在这个项目上所有的进步已经停止,因为这个错误出现了,我不能找到一种方法,在任何地方解决它。

All progress on this project has halted since this error appeared, and I could not find a way to fix it anywhere.

推荐答案

我开始在WPF4 / VS2010 / MVVMLight应用程序收到此错误。所有的建议提出了无果而终,直到我来到了一个关于创建一个新的应用程序和比较项目和XAML文件。这听起来像一个在黑暗中绝望的刺,但我继续尝试了。

I started getting this error on a WPF4/VS2010/MVVMLight app. All suggestions came up fruitless, until I came to the one about creating a new app and comparing the project and XAML files. This sounded like a desperate stab in the dark, but I went ahead and tried it.

在寻找其他的几个文件(!感谢天堂BeyondCompare),我发现我的App.xaml已经获得了一个额外的资源字典:

After looking at several other files (thank heaven for BeyondCompare!), I discovered that my App.xaml had acquired an extra resource dictionary:

<Application.Resources> <!--Global View Model Locator--> <vm:ViewModelLocator x:Key="Locator" d:IsDataSource="True" /> <ResourceDictionary> <vm:ViewModelLocator x:Key="Locator" d:IsDataSource="True" /> <ResourceDictionary.MergedDictionaries></ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources>

拆卸的ResourceDictionary块解决了这一问题。我仍然不知道这是如何发生的(我不是在编辑的App.xaml时候开始),而且目前还不清楚为什么VS报道这是静态主方法的错误。很奇怪。

Removing the ResourceDictionary block fixed the problem. I still have no idea how this occurred (I wasn't editing app.xaml when this started), and it's not clear why VS reported this as the "static 'Main' method" error. Very strange.

更多推荐

程序不包含一个静态的'主'适合入口点方法

本文发布于:2023-11-15 12:42:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1594543.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:静态   不包含   入口   适合   程序

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!