-3

I just disassembled it, I don't know if it's WPF or winforms, I just know there are about 10 namespaces and few hundred classes. How do I find the entrypoint of the exe?

Found it, it is Main() indeed...

justanothercoder
  • 223
  • 2
  • 4
  • 10

1 Answers1

0

Every console or windows application normally uses the Main() method to execute. This has to be static and looks like this:

public static void Main() {
    // your code
}

You can provide arguments.

The documentation states that

There can only be one entry point in a C# program. If you have more than one class that has a Main method, you must compile your program with the /main compiler option to specify which Main method to use as the entry point.

The mentioned parameter allows to specify the type containing the Main method. Still it has to be the Main. So it is necessary you name it like this.

See this question: C# entry point function for more information on the Main() and documentation for additional information.

Community
  • 1
  • 1
Sascha
  • 10,231
  • 4
  • 41
  • 65