Hi all,
I have created a windows service with .net 2.
I have installed the service but when I try to start it I get a message that the service has started and stopped as there was nothing to do.
I have noticed from some other similar problems on the net that this may be due to a thread not being started for each service.
There are three seperate services that I wish to run in this process and I have started them all from the program page like so:
Code:
static void Main()
{
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[] {
new SmsReceive(),
new SmsSend(),
new SmsRouting()
};
ServiceBase.Run(ServicesToRun);
}
In each of the services there is code like so:
Code:
protected override void OnStart(string[] args)
{
// TODO: Add code here to start your service.
PortUtilities.OpenPort(serialPort, ReceiveGsmModemPort);
serialPort.DataReceived += new SerialDataReceivedEventHandler(serialPort_DataReceived);
Watch();
}
SO each has some kind of loop to continue watching either a GSM Modem or a Message Queue.
How can I get these services running in processes that will not stop?
Many thanks for your time in advance.
Rod
======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================