Click here to Skip to main content
15,125,584 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This error
Error	1	Program 'i:\Desktop\WindowsFormsApplication3\obj\Debug\thomasapp.exe' does not contain a static 'Main' method suitable for an entry point	I:\Desktop\WindowsFormsApplication3\CSC	WindowsFormsAplication3
will not stop popping up and I have been working on a project. Can anyone help me fix this I have try this fourm.^ but it never worked at all!!!
Posted
Comments
Nicholas Marty 18-Nov-13 10:02am
   
Maybe you should also try to execute the exe in the "bin" directory instead of the "obj" one?

1 solution

Looking at the response you got at SO, and your comment it look like neither of your projects is intended to be executable - so why are you producing an EXE file that cannot be executed? If you are producing Class libraries (as it suggests) then you should be producing .DLL files instead.

After that, I assume that you are trying to build your projects by pressing F5 - which tries to execute the Startup Project - which in you case is neither of these two projects.
Either:
1) Add a static Main method which reports a problem and exits:
C#
[STAThread]
static void Main() { Console.WriteLine("This program is not executable"); }

Or
2) Add an executable program project to your solution and set it as the Startup project.

Myself, I'd go with the second option and use it as a "testbed" to test the other two projects...
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900