473,854 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using health monitoring or code to recycle the application?

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
Feb 23 '06 #1
3 1754
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.-
Feb 23 '06 #2
Glyn,

I've not used it myself, but you can use the new
WebConfiguratio nManager.OpenWe bConfiguration 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.or g> wrote in message
news:uQ******** ******@TK2MSFTN GP12.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

Feb 23 '06 #3
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*****@despam med.com> wrote in message
news:O5******** *****@tk2msftng p13.phx.gbl...
Glyn,

I've not used it myself, but you can use the new
WebConfiguratio nManager.OpenWe bConfiguration 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.or g> wrote in message
news:uQ******** ******@TK2MSFTN GP12.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


Feb 24 '06 #4

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

Similar topics

0
942
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
1
1179
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 fine, webpage prompted out, button clicked, however, no record was logged in table "aspnet_WebEvent_Events"! Then I stepped in to debug, the line testEvent.Raise();
1
1340
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 event logging for web requests. To do this I added the following markup to the <system.web> section of the web.config file in the service and application directories: <healthMonitoring enabled="true" heartbeatInterval="0"> <rules> <add...
2
2924
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 did not give me any hints WHERE and WHY I have all these restarts. Granted, I pay 20USD/month and they want for sure not spend hours for detecting my problem. I suspect that my ADO.NET calls to SQL Server have something to do with
4
3488
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 report for the databases. Also suggest me gud books for learning DB2. Thanks in advance,
1
1870
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 servers i get nothing logging. Any help would be great.Heres the relevant info from my web config. I know the connection string works as i use this else where in the site. <healthMonitoring enabled="true"> <eventMappings> <clear />
1
3012
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 been helpful, yet. As an example, here's a text copy of a typical unhandled exception from the event log: Event Type: Warning Event Source: ASP.NET 2.0.50727.0
0
1007
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 monitoring in 2.0, this should be super easy, but it's not. First off, there's no out-of-the-box provider for logging to a text file which is very strange. Microsoft at least provides some solutions to this problem on their website. I have...
2
1510
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 e-Intelligent Surveillance Systems and further enhance the public health monitoring and alert system 2.Develop a web based reporting program for communicable disease that accept electronic laboratory data from NIC health laboratory and other electronic...
0
9901
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11024
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10371
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9513
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7081
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5741
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4560
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4159
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3186
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.