views:

584

answers:

1

How to restart the w3wp.exe process using asp.net C#? For example, I want to click a button in a webform page to restart the w3wp.exe process in the server.

+1  A: 

You can force an application recycle by running the following code.

HttpRuntime.UnloadAppDomain()

Hope this helps.

Joel Cunningham
ASP.NET harakiri? What happens to the request that results in the UnloadAppDmain method call? What is returned to the browser? The worker process will only be recycled when IIS receives another request...
Ravish
Joel Cunningham, Thank you for your help.
Mike108