473,387 Members | 1,501 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,387 software developers and data experts.

how do I force HttpApplication.Application to restart

I would like to know if there is a programatic way to force the
Application object to restart. I have a hosted website where I will be
unable to control the webserver (eg:iisreset), and I would like to be
able to trap certain events and cause the entire application to reload.
Thanks in advance.
-Pint
Nov 19 '05 #1
3 3353
Pint wrote:
I would like to know if there is a programatic way to force the
Application object to restart. I have a hosted website where I will be unable to control the webserver (eg:iisreset), and I would like to be able to trap certain events and cause the entire application to

reload.

just change the last modification time of /web.config

Nov 19 '05 #2
I am not sure if there is a method call or something that would restart your
application (will find out and let you know if any ) but one way in which you
can restart your application is by changing a File ( say a log file or
something )in your virtual directory.As ASP.NET monitors the Virtual
directory adn any change in the file would trigger a restart.

Hope this helps
Shaun

"Pint" wrote:
I would like to know if there is a programatic way to force the
Application object to restart. I have a hosted website where I will be
unable to control the webserver (eg:iisreset), and I would like to be
able to trap certain events and cause the entire application to reload.
Thanks in advance.
-Pint

Nov 19 '05 #3
Don't think this is entirely true. A change in the web.config file forces a
restart of the application which results in the resulting of the application
object. It is true that ASP.NET monitors the virtual directory, if a file is
changed there, for example a code behind file which is referenced by the src
attribute of the page directive, this forces a recompilation of the .aspx
page. However, this doesn't result in an application restart as can be
checked by adding the following code to an .aspx page:

DateTime objDate;

if ( Application["Time"] == null )
{
Application.Lock();
Application["Time"] = DateTime.Now;
objDate = DateTime.Now;
Application.UnLock();
}
else
{
objDate = (DateTime) Application["Time"];
}

Response.Write(objDate.ToString());

Kind regards,
Nikander & Margriet Bruggeman

"Shaun" wrote:
I am not sure if there is a method call or something that would restart your
application (will find out and let you know if any ) but one way in which you
can restart your application is by changing a File ( say a log file or
something )in your virtual directory.As ASP.NET monitors the Virtual
directory adn any change in the file would trigger a restart.

Hope this helps
Shaun

"Pint" wrote:
I would like to know if there is a programatic way to force the
Application object to restart. I have a hosted website where I will be
unable to control the webserver (eg:iisreset), and I would like to be
able to trap certain events and cause the entire application to reload.
Thanks in advance.
-Pint

Nov 19 '05 #4

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

Similar topics

3
by: Robb Gilmore | last post by:
Hi, We have an ASP.NET web application that attempts to check some database conditions in Application_start to ensure that all is well before the app comes up. However, I figure out how to...
3
by: AinO | last post by:
Hi, - I've created a webservice in VS2003/c# wich relies heavily on cache. It has a cache manager wich loads resources (triggered by requests) and wich has also a built in timer wich triggers...
4
by: Halcyon Woodward | last post by:
I have an odd problem... We have a small development team (three coders) working on the same project (a C# web application). Each coder has a unique 'sandbox' site on a shared Windows 2003...
7
by: [Gauthier] | last post by:
Hello, I've a simple question: On a server that run multiple asp.net HttpApplication, is there any way with the asp.net framework to exchange data between different application? I basically...
5
by: Richard Myers | last post by:
Hello, I was recently asked how to ensure an app falls over when an exception occurs that has not been caught. The framework will often prompt the user to Quit or continue in such case and...
2
by: Urs Eichmann | last post by:
Upon startup of my ASP.NET 2.0 application, I check if the application configuration is in an acceptable state inside an override of HttpApplication.Init(). If not, I raise an exception from this...
5
by: pavel.orehov | last post by:
Hi, I am using UDP protocol for communication in my application in C#. I am using UdpClient class. The problem is that sometimes the UDP port remains opened/stucked even if I close the...
3
by: MarkusJNZ | last post by:
Hi, I have two different applications running on 2003 both in two different vitrual directories. One application runs on the .NET framework 1.1 whilst the other runs on 2.0. If I change the...
0
by: rbg | last post by:
Have a web application which uses Data Cache. I need to understand what happens when a new instance of the same web application is created for for serving concurrent clients. What happens when...
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
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...

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.