Re: killing a process in C# web application
- From: "Ben Voigt" <rbv@xxxxxxxxxxxxx>
- Date: Wed, 14 Jun 2006 18:17:59 -0500
"Rain" <Rain@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0B17ED69-C410-496D-BF47-B8B7DA663035@xxxxxxxxxxxxxxxx
Bacuase i always get an error telling me that only one socket can be used
or
something like that even if i already restarted the application. All my
sockets are killed b4 the application exits. The error message does not
appear when i manually kill the process.
I just need to kill the process b4 i exit so the next time i start my pp,
i
wont be encountering the error. Does anyone know the C# CODE for it?
I'm going to answer your question:
System.Diagnostics.Process.GetProcessById(...).Kill
But, you should still consider what everyone else is saying. Normally,
there is no reason to kill the ASP.NET worker process. Perhaps you should
build an aspx page that calls AppDomain.Exit(AppDomain.CurrentDomain), which
will kill your assemblies without affecting any other appdomains running in
the shared IIS ASP.NET process.
"Tom Porterfield" wrote:
Rain wrote:
Does anyone know how i can kill a process using C#? im developing an
asp.net web application using C# and the asp.net process doesnt die
even
if the application has already exited. So i need to kill the process
someone.. does anyone know the code for this? thank you so much in
advance!!!!
It is normal for the asp worker process to continue running after the
application has exited, this is how it is designed to work. Why do you
think you need to kill the process?
--
Tom Porterfield
.
- References:
- Re: killing a process in C# web application
- From: Tom Porterfield
- Re: killing a process in C# web application
- Prev by Date: Re: Strategic Functional Migration and Multiple Inheritance
- Next by Date: Re: ContextBoundObject And Serialization
- Previous by thread: Re: killing a process in C# web application
- Next by thread: Re: killing a process in C# web application
- Index(es):
Relevant Pages
|