S
sir dd
Hi,
I've got a Windows-service that runs nice and smooth on my local
machine, but when installed on a server it fails to start the thread
inside. I can't figure out what's wrong.
The code below executes as it should on my machine: test123 is written
to the eventlog, but it's not on the server where it should be
installed.
It has however run for a few days on the server, but just stopped one
day (perhaps after a reboot?). The eventlog isn't showing any error
messages either - the OnStart method is executed just fine (tested that
also by writing to the eventlog). Only the mythread function doesn't
get started anymore... Does anyone have any idea how that's possible?
Thanks in advance!
using System.Diagnostics;
using System.Threading;
namespace mynamespace
{
public class myservice: System.ServiceProcess.ServiceBase
{
...
protected override void OnStart(string[] args)
{
ThreadStart ts = new ThreadStart(mythread);
Thread t = new Thread(ts);
t .Start();
}
public void mythread()
{
EventLog.WriteEntry("test123");
try
{
...
}
catch(ThreadAbortException)
{
}
}
...
}
}
I've got a Windows-service that runs nice and smooth on my local
machine, but when installed on a server it fails to start the thread
inside. I can't figure out what's wrong.
The code below executes as it should on my machine: test123 is written
to the eventlog, but it's not on the server where it should be
installed.
It has however run for a few days on the server, but just stopped one
day (perhaps after a reboot?). The eventlog isn't showing any error
messages either - the OnStart method is executed just fine (tested that
also by writing to the eventlog). Only the mythread function doesn't
get started anymore... Does anyone have any idea how that's possible?
Thanks in advance!
using System.Diagnostics;
using System.Threading;
namespace mynamespace
{
public class myservice: System.ServiceProcess.ServiceBase
{
...
protected override void OnStart(string[] args)
{
ThreadStart ts = new ThreadStart(mythread);
Thread t = new Thread(ts);
t .Start();
}
public void mythread()
{
EventLog.WriteEntry("test123");
try
{
...
}
catch(ThreadAbortException)
{
}
}
...
}
}