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

web-app restart on file replacement

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
I'm asking about other ways to restart the web-app).

Thanks.

Nov 19 '05 #1
3 3166
You can restart only the application pool under IIS6 to achieve the same
effect but only do it for the specific application pool your app belongs to,
and thus not affect all the other sites. You can probably do this via the
cmd line but I am not sure of the syntax or cmd line arguments. Perhaps
someone else can chime in here.

For your XML file, I would be inclined to setup a file dependency in the
cache to detect when its changed, then programmaticaly do what needs to be
done in your application rather than trying to trigger a full app restart.
That seems like a very heavy handed approach.

--
- Paul Glavich
MVP ASP.NET
http://weblogs.asp.net/pglavich
ASPInsiders member - http://www.aspinsiders.com
"John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:ui**************@tk2msftngp13.phx.gbl...
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 I'm asking about other ways to restart the web-app).

Thanks.

Nov 19 '05 #2
Hi Paul, and thanks for the response.

Yes, web-app restart would seem to be more harmful than just triggerring
reload of all config settings. In some cases, new config settings might
mean some sessions get mulched depending on where they are in the e-commerce
sequence, but web-app restart would knock out all sessions.

What approach is typically used in production web-farm apps to handle
redeployment of various new .aspx pages, and/or .dll libs , and/or
strings.resx files ? Is traffic directed away from server 1, and when all
existing sessions time-out then server 1 is redployed , then go to server 2,
etc ? Or are the files just copied over with sessions in progress and
ASP.NET is left to perform its shadow-copying magic so that various old and
new sessions run against multiple file versions ?

What is your thinking on the security issues involved with locating numerous
app config settings (including various URLs , including web-service URLs) in
an XML file on each web-server (or on a separate machine that all
web-servers in the farm point to) ? How do you rate this versus locating
the config settings in the DB?

I like a XML config settings file because it is a single file that can be
tracked in source code control, and is straightforward to update (ops always
performs the same task - copy over the file). But security issues might
give the nod to the DB ...
"Paul Glavich [MVP ASP.NET]" <gl**@aspalliance.com-NOSPAM> wrote in message
news:uV**************@TK2MSFTNGP12.phx.gbl...
You can restart only the application pool under IIS6 to achieve the same
effect but only do it for the specific application pool your app belongs
to, and thus not affect all the other sites. You can probably do this via
the cmd line but I am not sure of the syntax or cmd line arguments.
Perhaps someone else can chime in here.

For your XML file, I would be inclined to setup a file dependency in the
cache to detect when its changed, then programmaticaly do what needs to be
done in your application rather than trying to trigger a full app restart.
That seems like a very heavy handed approach.

--
- Paul Glavich
MVP ASP.NET
http://weblogs.asp.net/pglavich
ASPInsiders member - http://www.aspinsiders.com
"John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:ui**************@tk2msftngp13.phx.gbl...
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 I'm asking about other ways to restart the web-app).

Thanks.


Nov 19 '05 #3
Hi Dear John A Grandy,

I was looking out for your answer; but right now i got only why
application will start, not how to start it. Anyway I just wanted to
share with you.
I will come back to you, the moment I got the answer.

here are the reasons

There are many causes to application recycle, the most common are:

1) Unhandle Exception.

2) Any write to application bin directory.

3) Any change to web.config.

4) Anti-virus program that touch files.

5) One of ProcessModel attribute in machine.config that cause
application recycling.

-----------------------------------------------------------------------
This talks about both 1.0 and 1.1

This behaviour has been bugging lots of people. ASP.Net will restart its
application for various reasons. All these reasons are legitimate, but
the side effect is that the application will reset all its cache,
application state, and InProc session states.
You can detect the restart of application and worker process by using
the performance monitor. The counters to monitor are
"ASP.NET\Application Restarts" and "ASP.NET\Worker Process Restarts".

For worker process restart, ASP.NET will write an entry in the eventlog
to explain why (logLevel in controls how often eventlog is written).

For application restart, however, in v1 and v1.1 there is no easy way
for a customer to figure out why a restart happened.

So by listing all reasons for app restart, I hope I can help some
customers to understand and avoid the restart.

For v1
------

Things that causes application restart:

- The max compilation limit is reached (look for
numRecompilesBeforeApprestart in machine.config)

- Physical application path of the web application has changed.

- Change in global.asax or one of the included files

- Change in machine.config

- Change in web.config in the app root

- Change inside bin directory or its subdirs

- A directory is renamed to bin, or bin is created

- Overwhelming change notifications too many files are changed too
fast in one of content directories could happen if, for example, files
are generated on the fly per request

- Change in the code-access security policy file

- The settings of various attributes in in machine.config affect the
restart/shutdown of the worker process itself. However, if you use
Windows 2003, and (by default) you are NOT using IIS5 isolation mode, is
ignored. Instead, the settings in "Application Pools" in IIS manager is
used.
For v1.1
--------
The list for v1.1 is the same as v1, with the following new conditions:

- User code called HttpRuntime.UnloadAppDomain

- Any directory under the web application folder is renamed

IIS 6.0
--------
If you're using IIS 6.0, and you're not using IIS 5 compatible mode,
then aspnet_wp.exe will be replaced by w3svc.exe. You may want to go to
IIS Manager, go to Application Pools/DefaultAppPool, and see if any of
the parameters on the Recycling and Performance tabs are causing the IIS
worker process (w3svc.exe) to shutdown.

Bye
Venkat_KL

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 19 '05 #4

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

Similar topics

0
by: Phillip J. Eby | last post by:
PEP: 333 Title: Python Web Server Gateway Interface v1.0 Version: $Revision: 1.1 $ Last-Modified: $Date: 2004/08/27 17:30:09 $ Author: Phillip J. Eby <pje at telecommunity.com> Discussions-To:...
2
by: PatrickSA | last post by:
Hi, Am new to web services, so apologies for the basic nature of the question - and apologies in advance if this is the wrong newsgroup. We're building a new web service and I'm looking around...
10
by: Jeremy Ames | last post by:
I have created a web application that uses a custom control and a web service on my local system. I have gotten all of the bugs worked out on my local system and now it is time to move it to the...
0
by: Erick Lopez | last post by:
When I send my web page to browser in ouput windows recibe this message and the web page the error BC32400 Please Help me Auto-attach to process ' aspnet_wp.exe' on machine 'TABLET'...
5
by: Michael Herman \(Parallelspace\) | last post by:
1. What are some compelling solutions for using Master/Content pages with Web Pages? 2. If a content area has a web part zone with web parts, what is the user experience like when "editting" the...
0
by: pd123 | last post by:
I'm new to C# and .net and I'm trying to create a form that will register users in a sql server database. I have the following code but when I run the code I get an error " The name 'Peter' is...
7
by: Jonas | last post by:
Hi. I'm trying to develop a web custom control that uses a programmatically created treeview. My problem is that I get an exception when I try to render the control. With properties do I have to...
0
by: nicomp | last post by:
I created a Web Service: I imported System.Data.SqlClient so I could access SQL server tables programmatically. The web service builds and deploys with no problems. When I try to add the...
2
by: job | last post by:
In a sharepoint setup using smartpart to load our user controls using enterprise blocks (data) we are getting some strange errors (logged to the event log). We dont get the error all the time. When...
3
by: =?Utf-8?B?RGFuZGFuIFpoYW5n?= | last post by:
Now I have a web application, a web service and a SQL Server database. The Web application will invoke the web service, the web service invokes the SQL Server stored procedure. I let the web...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

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.