Build error

Ranorex Spy, Recorder, and Studio.
tsyingling
Posts: 20
Joined: Wed Nov 04, 2009 5:18 pm

Build error

Post by tsyingling » Wed Nov 04, 2009 5:22 pm

I'm getting the following error trying to build a project "Program 'c:\Documents and Settings\yingti00\My Documents\RanorexStudio Projects\ICDMaintList\ICDMaintList\obj\Debug\ICDMaintList.exe' does not contain a static 'Main' method suitable for an entry point (CS5001)". What does this mean and how do I fix it?

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Build error

Post by Ciege » Wed Nov 04, 2009 5:54 pm

You need to have a main method in your code. This is the method that allows an entry into your script. I.e. the starting method, or the first thing that is run when your script executes.

Add a method to you script like the following:

Code: Select all

[STAThread]
static void Main(string[] args)
{ 
//call you first test here
}
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

tsyingling
Posts: 20
Joined: Wed Nov 04, 2009 5:18 pm

Re: Build error

Post by tsyingling » Wed Nov 04, 2009 6:04 pm

Thanks. Not sure what happened. Ran the build from Ranorex Studio for a new project and my program.cs file seemed to disappear. Had done previous build for project and seemed OK. Not sure if the error removed the file. I imported a program file from another project and rebuilt. All seems good now.