473,320 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Programmatically Recycling IIS Application Pools

Ram
Hey,
Is there a way to remotely Recycle IIS 6.0 Application Pools in .Net?
Thanks ahead

--Ram
Nov 16 '05 #1
3 11891
to recycle using script see this
http://groups.google.ca/groups?q=rec...phx.gbl&rnum=1
for codebehind see this

void RestartApplicationPool(string applicationPoolName)
{
if (applicationPoolName == null)
{
throw new ArgumentNullException("applicationPoolName");
}

using (DirectoryEntry applicationPool = new
DirectoryEntry("IIS://localhost/W3SVC/AppPools/" + applicationPoolName))
{
applicationPool.Invoke("Recycle");
}
}

--
Regards,
Alvin Bruney

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
------------------------------------------------------------

"Ram" <ni***@bezeqint.net> wrote in message
news:O7**************@TK2MSFTNGP09.phx.gbl...
Hey,
Is there a way to remotely Recycle IIS 6.0 Application Pools in .Net?
Thanks ahead

--Ram

Nov 16 '05 #2
Ram
Thanks alot!

Ram
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> wrote in message
news:OB**************@TK2MSFTNGP15.phx.gbl...
to recycle using script see this
http://groups.google.ca/groups?q=rec...lm=OptknwINDHA
..3664%40tk2msftngp13.phx.gbl&rnum=1 for codebehind see this

void RestartApplicationPool(string applicationPoolName)
{
if (applicationPoolName == null)
{
throw new ArgumentNullException("applicationPoolName");
}

using (DirectoryEntry applicationPool = new
DirectoryEntry("IIS://localhost/W3SVC/AppPools/" + applicationPoolName))
{
applicationPool.Invoke("Recycle");
}
}

--
Regards,
Alvin Bruney

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
------------------------------------------------------------

"Ram" <ni***@bezeqint.net> wrote in message
news:O7**************@TK2MSFTNGP09.phx.gbl...
Hey,
Is there a way to remotely Recycle IIS 6.0 Application Pools in .Net?
Thanks ahead

--Ram


Nov 16 '05 #3
Ram
Um...
Well I just tested the same code (the code you gave me earlier) on VS.NET
2003 and it didnt work!
When trying to bind the DirecforyEntry, I get:
"The Value Provided For adsObject Does Not Implement IADs"
While the SAME code works perfectly well on VS.NET 2005 - (Whiebey's
Beta)!!!
Please Help!

Ram
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> wrote in message
news:OB**************@TK2MSFTNGP15.phx.gbl...
to recycle using script see this
http://groups.google.ca/groups?q=rec...lm=OptknwINDHA
..3664%40tk2msftngp13.phx.gbl&rnum=1 for codebehind see this

void RestartApplicationPool(string applicationPoolName)
{
if (applicationPoolName == null)
{
throw new ArgumentNullException("applicationPoolName");
}

using (DirectoryEntry applicationPool = new
DirectoryEntry("IIS://localhost/W3SVC/AppPools/" + applicationPoolName))
{
applicationPool.Invoke("Recycle");
}
}

--
Regards,
Alvin Bruney

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
------------------------------------------------------------

"Ram" <ni***@bezeqint.net> wrote in message
news:O7**************@TK2MSFTNGP09.phx.gbl...
Hey,
Is there a way to remotely Recycle IIS 6.0 Application Pools in .Net?
Thanks ahead

--Ram


Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Grinninger | last post by:
Hello, I am using ASP.NET, C# under W2K. I try to keep some important information in application- and session-state Objects. With the recycling of the ASPNet_WP.EXE my application- and...
6
by: mark | last post by:
Just wondering if anyone has aspnet process recycling set up in any production environments. Our worker process memory gets out of control after being up for about a day or so and we were thinking...
1
by: Ollie | last post by:
When an application pool is recycled in IIS 6.0, What happens to the HttpContext.Cache in an asp.net application, Does it persist across the recycle? Cheers Ollie
0
by: Ram | last post by:
Hey, Is there a way to remotely Recycle IIS 6.0 Application Pools in .Net? Thanks ahead --Ram
11
by: Ravi Ambros Wallau | last post by:
Dear friends: This is my third question on this news in three days... Sorry for this spam behavior :-) I've a lot of problems on "first page load" after some change on web.config or even in the...
5
by: Ed | last post by:
I have some questions in regards to Session variables and IIS Recycling: 1. Does the IIS setting 'Shutdown worker process after being idle' affect an application's session variables? Or is IIS...
5
by: Tony | last post by:
Hi all, Here's the link to the issue we were seeing on our ASP.NET system when modifying, adding and deleting directories in framework 2.0....
6
by: M Craig | last post by:
I'm trying to write a custom installation engine to plug into our existing build system. Some things I'm trying to do are, Create/Delete/Start/Stop Application Pools, Web Sites, and Virtual...
4
by: Oriane | last post by:
Hello, I will soon installed a small Ajax Asp.Net "single page" site on a client site. This page is simply polling a Asp.Net Web service, which fetchs and returns parameters (temperature, air...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.