MrFawlty
asked on
Convert a working Console Application to a working Windows Service
Hi,
I have a console application that communicates with an exchange webservice in order to subscribe to new mail events, when a new mail is received the mail is processed and entered into a SQL DB. I've been trying (and failing) to convert this app into a working Windows Service. Either it starts and stops immediately or I get a FileNotFoundException in the Main() but all seems in order there so far as I can tell.
Any pointers? I have been googling qutie fervently but nothing has really helped me so far.
I have a console application that communicates with an exchange webservice in order to subscribe to new mail events, when a new mail is received the mail is processed and entered into a SQL DB. I've been trying (and failing) to convert this app into a working Windows Service. Either it starts and stops immediately or I get a FileNotFoundException in the Main() but all seems in order there so far as I can tell.
Any pointers? I have been googling qutie fervently but nothing has really helped me so far.
Maybe the problem is that the console application fails as soon as it starts. Can you please post the code in the sub Main()?
the service needs to be instantiated in the first 30 seconds. otherwise it stops. you should add tracing to your service to see what it does (http://www.emoreau.com/Entries/Articles/2003/11/Code-diagnostic-an-article-on-tracing-and-debugging.aspx).
check http://www.vbdotnetheaven.com/UploadFile/mahesh/Winservvb11172005233242PM/Winservvb.aspx
check http://www.vbdotnetheaven.com/UploadFile/mahesh/Winservvb11172005233242PM/Winservvb.aspx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.