Windows Service 
Author Message
 Windows Service

Building a Windows Service in VB.net...

Is there a way to cancel the service start, e.g. when an exception is caught
in the OnStart method?

Several things should happen in OnStart, such as loading data and
instanciating objects. If any of these go wrong, I want to keep the service
from starting.

Thnx,
flip



Mon, 31 Jan 2005 21:11:22 GMT  
 Windows Service
Hi,

Just throw exception out of the OnStart Method. The ServiceBase will catch
it and write the exception information to the event log and mark the
service as stopped.

I hope this helps. If you have any questions, please reply to this post.

Best Regards,

Jun Su
Microsoft Support

---
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

| Subject: Windows Service
| Date: Thu, 15 Aug 2002 15:11:22 +0200
|
| Building a Windows Service in VB.net...
|
| Is there a way to cancel the service start, e.g. when an exception is
caught
| in the OnStart method?
|
| Several things should happen in OnStart, such as loading data and
| instanciating objects. If any of these go wrong, I want to keep the
service
| from starting.
|
| Thnx,
| flip
|
|
|
|



Tue, 01 Feb 2005 13:45:33 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Service description for Windows Service

2. Windows Service in VB.NET - Failed to process service command

3. Launch Windows form, from a Windows Service Application

4. installing web app with windows service and windows aplication at same time

5. Installing windows service in Windows 98,ME

6. Notifyicon in Windows service

7. Windows Services

8. Good reference/resource for building Windows Services??

9. Change account of already installed Windows Service

10. Threading and Windows Services

11. Advice on Multi-Tasking / Windows Services

12. reading web.config type file from windows service

 

 
Powered by phpBB® Forum Software