Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No main() in c# project

The issue I'm having is trying to find the run order for a number of classes in a project. There is no explicit main and I have looked in obj/debug and found nothing which might have been generated at compile time. Have you any ideas where I might find something. Also I cannot find any xaml files either. It's a console function.

like image 948
disruptive Avatar asked Nov 28 '22 07:11

disruptive


1 Answers

This is a quick way to find the entry point (if there is one):

Without any specific source file open, press F11 to start the debugger at the first line. This should make your entry point obvious.


Note that if this is a Console Application like you said, there must be a static main() method.

Here is the documentation for 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.

like image 105
Gray Avatar answered Dec 13 '22 21:12

Gray