Application just run on development-system

  • Thread starter Thread starter Pascal Frey
  • Start date Start date
P

Pascal Frey

Hi,

I just wrote a small simple C# application with a small gui. I was testing
the application continous on my development system. Now i tried to let it
run on another system but it doesn't.
On my system, i start the appl.exe file and the gui appears. there are 4
threads running as the taskmanager shows me. then i click on the start
button and the application starts reading data from a mysql database. the
thread count is going up to 5 and when the connection to the mysql server
happens it goes up to 12. and everything is working normally :-)

On the system on that the application should run i start the appl.exe file.
the gui appaers also with a thread count of 4 in the taskmanager. the the
click on the same button. the thread count goes up to 5 for a short time and
returns to 4. nothing happens anymore. the gui is not frozen, so i can move
it around and so on. some text messages telling me, that the application is
stopping somewhere when it should create a normal object (like Client c =
new Client() ).... What's wrong? Where do i have to search for the problem?
What is the problem?

Thanks for any idea and help

Greetz,
Pascal
 
One option (and often my favorite) is to use remote debugging to connect to
the process on the other machine and be able to step through code on your
development machine to see where things are going.

A far quicker option is to simply throw in some message boxes here and
there, reporting the current location and state of the applications
execution, giving you a high level overview of where the application might be
hanging up. As you learn which paths it is taking and where it is probably
breaking down, you can remove some of the older message boxes and throw in
some new ones.

I would however suggest remote debugging if that is an option for you.

See
http://msdn.microsoft.com/library/d...ug/html/vctskInstallingRemoteDebugMonitor.asp for some info on how to set it up.

Brendan
 
The problem is solved :-)

at the point where i was creating an instance of the client Client c = new
Client() the thread got an exception, because inside the Client class i was
triying to define some mySQL specific variables like "MySqlConnection". And
on the target machine the library (.dll) was missing.

public class Client {
privavte MySqlConnection con = null;
...
public Client() {}
...

There will be thrown an Exception on the "new()"

Thanx for helping
 
hi,

obviously it/s a problem with the 5th thread :)

Probably you are getting an exception but as it happens in a worker thread
your app does not finish cause of it.

first of all, use a try/catch in that thread, then either create a log with
this piece of code:
catch( Exception ex)
{
using ( EventLog e= new EventLog("Application",".","CTPWeb") )
{
e.WriteEntry("Error : " + ex.Message + " ST : " + ex.StackTrace,
EventLogEntryType.Error);
}
}

or maybe display it in the gui ( remember to use Control.Invoke )

probably you have issues connecting to the SQL server


cheers,
 
Back
Top