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_Start Event when the app is first
time launched and after you finished some data initial operations(about
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 programmatically
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(appdomain) 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.asp?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