Hi
I've got an ASP.NET 2.0 application, and I would like to catch the scenario
of when I get a certain number of application errors, I want to restart the
application (similar to 'touching' web.config).
However, I don't have access to IIS, nor can I FTP in a new web.config file
to force the application to restart.I can't see any way at the moment to do
this through code, which would be good, as I can then restart it remotely
(through a web handler).
Is there any way in code that I can do this, either through health
monitoring for it to happen automatically, or through other code (perhaps
with me putting in my authentication details that I use to upload the site)
that can force an application restart?
Thanks in advance..
Glyn
--
Glyn Simpson
Money MVP 3 1716 Is there any way in code that I can do this, either through health monitoring for it to happen automatically, or through other code (perhaps with me putting in my authentication details that I use to upload the site) that can force an application restart?
this is a trick: whenever you want your appdomain recycled, create a file
named App_Offline.htm inside the root of your application, wait 1 second,
asp.net will notice the file and recycle automatically, then cancel the file
or all of the requests will be redirected to this static file, and I'm sure
this is not what you want :-) by the way this trick is also used by vs.2005
spa.-
Glyn,
I've not used it myself, but you can use the new
WebConfigurationManager.OpenWebConfiguration Method, which give you write
access to web.config to touch the web.config and force a safe restart of the
application.
Whats interesting in your scenario is that you can do it from another web
application.
--
Regards
John Timney
Microsoft MVP
"Glyn Simpson, MVP" <gl**@serf.org> wrote in message
news:uQ**************@TK2MSFTNGP12.phx.gbl... Hi
I've got an ASP.NET 2.0 application, and I would like to catch the scenario of when I get a certain number of application errors, I want to restart the application (similar to 'touching' web.config).
However, I don't have access to IIS, nor can I FTP in a new web.config file to force the application to restart.I can't see any way at the moment to do this through code, which would be good, as I can then restart it remotely (through a web handler).
Is there any way in code that I can do this, either through health monitoring for it to happen automatically, or through other code (perhaps with me putting in my authentication details that I use to upload the site) that can force an application restart?
Thanks in advance..
Glyn
-- Glyn Simpson Money MVP
Thanks John and Spartaco
I am investigating using rewriting the web.config file, and programmatic
impersonation ( http://west-wind.com/weblog/posts/1572.aspx) to do it and it
looks like, on initial tests I am able to remotely restart the application.
So i'm now halfway to the desired solution of a fully automatic restart.
I'll do a bit more reading up on the health monitoring to see if I can go
the whole hog, but if not, the halfway point helps enormously.
Thanks!
--
Glyn Simpson
Money MVP
I do not respond to any unsolicited email regarding Money
"John Timney ( MVP )" <ti*****@despammed.com> wrote in message
news:O5*************@tk2msftngp13.phx.gbl... Glyn,
I've not used it myself, but you can use the new WebConfigurationManager.OpenWebConfiguration Method, which give you write access to web.config to touch the web.config and force a safe restart of the application.
Whats interesting in your scenario is that you can do it from another web application.
-- Regards
John Timney Microsoft MVP
"Glyn Simpson, MVP" <gl**@serf.org> wrote in message news:uQ**************@TK2MSFTNGP12.phx.gbl... Hi
I've got an ASP.NET 2.0 application, and I would like to catch the scenario of when I get a certain number of application errors, I want to restart the application (similar to 'touching' web.config).
However, I don't have access to IIS, nor can I FTP in a new web.config file to force the application to restart.I can't see any way at the moment to do this through code, which would be good, as I can then restart it remotely (through a web handler).
Is there any way in code that I can do this, either through health monitoring for it to happen automatically, or through other code (perhaps with me putting in my authentication details that I use to upload the site) that can force an application restart?
Thanks in advance..
Glyn
-- Glyn Simpson Money MVP
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Fump |
last post by:
Hello
I create a test with application center to monitor my ASPNET web application
** Description test
8 hour
10 connection
Enable Delays = Ye
|
by: athos |
last post by:
Dear All,
I am following the msdn guidelines
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/paght000011.asp)
trying the Health Monitoring module. Everything looks...
|
by: russell.lane |
last post by:
This is a health monitoring for web applications / web services question.
I'm trying to set up health monitoring for web services and a web
application. To start very simply, I want to turn on...
|
by: wwwmike |
last post by:
My applications (ASP.NET 2.0 /IIS 6) get restarted almost every 20
mintues.
When asking my dear provider, he/she replied that I should have a
closer look into my source code. Unfortunatelly they...
|
by: Maddy |
last post by:
Hi all,
I am new to DB2 database.I just have the basic knowledge abt this
database.I in a serious situation of handling 5 large databases.Can
some one help me how to prepare the health check...
|
by: =?Utf-8?B?RGlnaXRhbERpYW1vbmQ=?= |
last post by:
I'm fairly new to dotNet but I've set up a web site and SQL database, with
Health monitoring on which works fine localy on my development machine.
However when ever upload the web site to our web...
|
by: brad.serbus |
last post by:
I am trying to figure out a way to have health monitoring throw
different Event IDs into the event log, and am having a hard time.
None of the customization that I have looked through so far has...
|
by: andrew.douglas11 |
last post by:
Hello all,
I've been struggling on something that should be very easy. I want to
log every unhandled exception that occurs in my web app to a text
file. With the introduction of health...
|
by: paeh |
last post by:
Can any expert help me. I need to finish up my final project system next year. Can anyone give me some idea how to code my system. My system details is below :
1.Develop modules for a...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |