How to do I specify which main to use in a project

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
T

Tony Johansson

Hello!

I have a project where I have several files with a main method.
I just want to know how I specify which one to use.

//Tony
 
I have a project where I have several files with a main method.
I just want to know how I specify which one to use.

In Visual Studio, you go to project properties, "Application" tab, and
choose the class you want from the "Startup object" dropdown.

When compiling .cs files from command line, you use the /
main:<classname> switch.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top