473,785 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Restart Web Application in Global.Asax?


In the Application_OnS tart, I make some data calls and place the
results in the HTTP cache. Sometimes, the database is not available
when the application starts up, so I want to sleep for 20 seconds and
then restart the entire application.

What is the best way to do that?

Thanks.

Nov 18 '05 #1
1 4137
Hi Localhost,
Thanks for posting in the community!
From your description, you're wanting to manually restart the ASP.NET
application in application's Application_Sta rt Event when the app is first
time launched and after you finished some data initial operations(abou t
20-30 seconds), yes?
If there is anything I misunderstood, please feel free to let me know.

Based on my experience, every ASP.NET web application is limited in a
separate AppDomain itself. And currently, the framework doesn't seem to
provide buildin explicit APIs for restarting the asp.net programmaticall y
in application self. However, there're some situations which may cause the
aspnet_wp worker process or a certain application's appdomain restart
passively, here is the circumstances:

# Setting an attribute in the <processModel > element of the application's
Web.config file that causes a new process to start when a condition is met,
such as memoryLimit.

# The Global.asax or Web.config file is modified.

# Changes to the \Bin directory of the Web application.

# Antivirus software scans and modifies the Global.asax file, the
Web.config file, or a file in the \Bin directory of the Web application.
But the above circumstances can't ensure the appdomain or workprocess
restart immediately, maybe it'll need one or two minute for the app to deal
with some processing tasks for the current service requests.

In addition, I still recommend that you not restart the whole
application(app domain) since that'll cause many unnecessary initialize
operations. Do you think it possbile that you just sleep for several
seconds and then contrinue the web app without restart the web application?
Or just sleep the thread and create another background thread to finish
some other operations?

Further more, the ASP.NET process model within IIS5 and IIS6 are also quite
different. The IIS6 provide some further features to control workerprocess,
you may have a view at the following reference if you're using IIS6:

#IIS 6.0 Application Isolation Modes
http://msdn.microsoft.com/library/en...0applicationis
olationmodes.as p?frame=true

Please check out the preceding items. If you have any questions, please
feel free to post here.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #2

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

Similar topics

2
4590
by: Chris Langston | last post by:
I have a Web Server running IIS 5 or 6 on Windows 2K and Windows 2003 Server that is experiencing strange shutdown problems. We are using ASP.NET v1.1 and our application is written in VB.NET Here's the scenario: 1. .NET Windows Client on a remote machine makes a web service call to update tables on a Web Server running SQL Server 2000. 2. The Update is updating about 1000 - 3000 records doing simple update statements like "Update...
6
2638
by: jim | last post by:
Hi All, I like to know the life cycle of an ASP .NET Application( incudieng server application, such as .NET Web Service). That means from initialization to fully running and how to reboot it or shut it down. Including how to establish the running environment( current working folder, ...etc) for each ASP .NET application. Because in my ASP .NET application, there are a lot of modules. Some were developed by using VC#, others using...
4
5002
by: Kenneth P | last post by:
Hi, I have my asp.net apps on a web hotel, and thus I have whatsoever no control of the IIS on my server. If I make a change in the global.asax for my application,. what is needed to get the IIS to make the changes? TIA
8
4871
by: Vishwanathan Raman | last post by:
Hi I have a declared a static DataSet object SOBJ in Global.asax.I also have a localy defined DataSet LSOBJ in Global.asax which I am storing in Application State.Is there any technical differences in the way both the objects are handled by IIS. Are both objects stored in different memory spaces? I can access both the objects in my web page. I will be grateful if some one can help me understand the difference.
3
2781
by: ad | last post by:
I want to renew all values of Application and Session. How can I restart application in program?
3
3216
by: John A Grandy | last post by:
In ASP.NET 1.1 and/or 2.0 ..... Is it possible to configure a web-app so that replacement of an .xml file ( physically located under the virtual dir root ) with a newer version of the file causes a web-app restart ... ? Also, is a stopping and starting a website in IIS the only way to restart a web-app ? (Of course, iisreset stops and starts all web-apps on the web-server ... but
3
2150
by: Ray Booysen | last post by:
In our application, we merge documents for our clients. The directory structure is as follows: webroot ->bin ->Documents ->Company -> Company X
4
1223
by: mark4asp | last post by:
How can I shut down (only one) ASP.NET website on the server. Problem. I have updated my web-site but the site which I see is the old one (the one there prior to the update). I do I force ASP.NET to use the code in the new site - including the new global.asax settings. ? I have set the HTTP headers to expire after 1 minute. I have put the
1
2643
by: Brian Simmons | last post by:
Hi All, I know that if you modify the web.config file or any file in the App_Code subfolder, that ASP.net 2.0 will "restart" the application (i.e. clear out any sessions, etc...). Are there any other changes that restart the application? Will modify a code-behind .cs/.vb which calls a class in the App_Code folder restart the application?
0
10330
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
10153
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10093
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8976
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
5381
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...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
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
3654
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2880
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.