c# - c# 项目中没有 main()

标签 c# visual-studio-2012

我遇到的问题是试图找到项目中多个类的运行顺序。没有明确的 main,我查看了 obj/debug,没有发现任何可能在编译时生成的东西。你有什么想法我可能会找到一些东西。我也找不到任何 xaml 文件。这是一个控制台功能。

最佳答案

这是找到入口点(如果有的话)的快速方法:

在没有打开任何特定源文件的情况下,按 F11 在第一行启动调试器。这应该使您的切入点显而易见。


请注意,如果这是您所说的控制台应用程序,则必须有一个 static main() 方法。

这是 Main() 的文档:

The Main method is the entry point of a C# console application or windows application. (Libraries and services do not require a Main method as an entry point.). When the application is started, the Main method is the first method that is invoked.

关于c# - c# 项目中没有 main(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19163468/

相关文章:

.net - MSBuild AfterBuild 消息未实时显示

c# - Visual Studio Intellisense颜色编码不起作用

c# - 无法导入 WSDL 服务 "targetNamespace ' urn :webservice' not found'

c# - .Net Core 3.0 JsonSerializer 填充现有对象

c# - 将 ComboBox 的 ItemsSource 提交给 ValidationRule

visual-studio - VS 2012 通用测试无法部署文件

c# - 如何动态实例化对象?

c# - SQL查询结果到数组/列表

c++ - 如何最好地将 Xcode 和 Visual Studio 与同一个 git 存储库一起使用?

c++ - 为什么新的 Visual Studio 运行时不是 Windows 的一部分