Hi Bill,
Is your problem resolved?
If you have any question, please feel free to let me know.
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
| Content-Class: urn:content-classes:message
| From: "Bill" <an*******@discussions.microsoft.com>
| Sender: "Bill" <an*******@discussions.microsoft.com>
| References: <Ov**************@TK2MSFTNGP09.phx.gbl>
<H9**************@cpmsftngxa06.phx.gbl>
<0c****************************@phx.gbl>
<K3**************@cpmsftngxa06.phx.gbl>
| Subject: RE: Windows Services shutdown order
| Date: Wed, 22 Oct 2003 06:22:44 -0700
| Lines: 173
| Message-ID: <05****************************@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcOYn5O5V0KNMcT2QbWI+w2WP032tw==
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:193156
| NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Thanks for your help. I'll give that a try
|
| ~Bill
|
| >-----Original Message-----
| >
| >Hi Bill,
| >
| >I have tried to send mail in Shutdown event, it works
| well, and my smtp
| >server is not on the same machine with the application.
| >As you said your smtp server is no another machine, I
| think you should not
| >get any trouble of sending mail in shutdown event.
| >
| >I think you can create a tmp file on disk in shutdown
| event, then you can
| >affirm your shutdown event is called corrently.
| >Something like this:
| >protected override void OnShutdown()
| >{
| > FileStream f=File.Create("D:\\onshutdown.txt");
| > base.OnShutdown ();
| >}
| >
| >Best regards,
| >Jeffrey Tan
| >Microsoft Online Partner Support
| >Get Secure! -
www.microsoft.com/security
| >This posting is provided "as is" with no warranties and
| confers no rights.
| >
| >--------------------
| >| Content-Class: urn:content-classes:message
| >| From: "Bill Sonia" <bi*******@achaiasolutions.com>
| >| Sender: "Bill Sonia" <bi*******@achaiasolutions.com>
| >| References: <Ov**************@TK2MSFTNGP09.phx.gbl>
| ><H9**************@cpmsftngxa06.phx.gbl>
| >| Subject: RE: Windows Services shutdown order
| >| Date: Tue, 21 Oct 2003 07:09:53 -0700
| >| Lines: 97
| >| Message-ID: <0c****************************@phx.gbl>
| >| MIME-Version: 1.0
| >| Content-Type: text/plain;
| >| charset="iso-8859-1"
| >| Content-Transfer-Encoding: 7bit
| >| X-Newsreader: Microsoft CDO for Windows 2000
| >| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| >| Thread-Index: AcOX3P+0rz/7d7qaRr6m4jMwxGy8Ng==
| >| Newsgroups: microsoft.public.dotnet.languages.csharp
| >| Path: cpmsftngxa06.phx.gbl
| >| Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.languages.csharp:192876
| >| NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
| >| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| >|
| >| My smtp server is on another machine. Can you think of
| a
| >| particular service that I should ad a dependecy to?
| >|
| >| >-----Original Message-----
| >| >
| >| >Hi Bill,
| >| >
| >| >I think your stmp server is on the same machine as
| your
| >| windows service.
| >| >If you use the smtp server on other machine, all will
| go
| >| well.(I have tried
| >| >this)
| >| >
| >| >I think you can make 2 service, A depends on B, all
| write
| >| log to the Event
| >| >Log in ShutDown event. Then you can check the log
| order
| >| in the Event Viewer
| >| >if the dependency applies on shutting down.
| >| >
| >| >Because sending mail through smtp is a long time
| process,
| >| I think even if
| >| >your dependency take effect the sending process may
| fail.
| >| >So I think you should use the smtp on other machine.
| >| >
| >| >Hope this helps,
| >| >
| >| >Best regards,
| >| >Jeffrey Tan
| >| >Microsoft Online Partner Support
| >| >Get Secure! -
www.microsoft.com/security
| >| >This posting is provided "as is" with no warranties
| and
| >| confers no rights.
| >| >
| >| >--------------------
| >| >| From: Bill Sonia <bi*******@achaiasolutions.com>
| >| >| X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
| >| >| Subject: Windows Services shutdown order
| >| >| Mime-Version: 1.0
| >| >| Content-Type: text/plain; charset="us-ascii"
| >| >| Content-Transfer-Encoding: 7bit
| >| >| Message-ID: <Ov**************@TK2MSFTNGP09.phx.gbl>
| >| >| Newsgroups: microsoft.public.dotnet.languages.csharp
| >| >| Date: Mon, 20 Oct 2003 10:11:15 -0700
| >| >| NNTP-Posting-Host: actionjackson133.dsl.frii.net
| >| 216.17.147.133
| >| >| Lines: 1
| >| >| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!
| >| TK2MSFTNGP09.phx.gbl
| >| >| Xref: cpmsftngxa06.phx.gbl
| >| microsoft.public.dotnet.languages.csharp:192632
| >| >| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| >| >|
| >| >| I've written a Windows Service to send e-mails on
| >| events like OnStart,
| >| >| OnStop, OnShutDown using System.Web.Mail. It works
| for
| >| everything but
| >| >| OnShutdown. My guess is that for OnShutDown, once
| my
| >| send mail code is
| >| >| executed, other necessary Windows Services have been
| >| terminated before
| >| >| it can actually send the mail. I've updated my
| >| >| HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es
| >| registry
| >| >| DependOnService value including SMPTSVC and others.
| My
| >| hope is that the
| >| >| services will shut-down in reverse order from start-
| up;
| >| I haven't had
| >| >| any luck with this.
| >| >|
| >| >| My Questions:
| >| >| Do Windows Services (Windows 2000) shutdown in the
| >| reverse order from
| >| >| which they start-up?
| >| >|
| >| >| If so, any idea's as to which service I should
| include
| >| as a dependency?
| >| >|
| >| >| If not, is there anyway I can ensure my Windows
| Service
| >| is
| >| >| the first to shutdown?
| >| >|
| >| >| Thanks,
| >| >|
| >| >| ~Bill
| >| >|
| >| >| ________________________
| >| >| Bill Sonia
| >| >| Achaia Solutions, Inc
| >| >|
www.achaiasolutions.com
| >| >|
| >| >| *** Sent via Developersdex
|
http://www.developersdex.com
| >| ***
| >| >| Don't just participate in USENET...get rewarded for
| it!
| >| >|
| >| >
| >| >.
| >| >
| >|
| >
| >.
| >
|