What happens to ApplicationState if IIS decides to spawn another app domain for an ASP dot net appli

  • Thread starter Thread starter newjazzharmony
  • Start date Start date
N

newjazzharmony

I have heard that IIS may decide to spawn one or more additional app
domains for a single ASP dot net application.
Is this true?
Is there a difference in how this works in IIS 5 and IIS 6?
Is it configurable?

Finally, if a new app domain is spawned for a single application, does
this equate to a totally different application (with its own
Application state, and its own Application_Start/Application_End
events, etc.)?

Thanks,
Jonathan
 
IIS does not control appdomain, this is done by the asp.net isapi filter.
asp.net run a file monitor looking for changes to files. if any changes are
seen, on the next request, a new appdomain is spun up (to load the new code
in), and all new requests go to it. the old app domain finishes the request
its processing and exits (hopefully). spinning up the new appdomain fires
Application start/etc and a new Application state.

while its technically possible to copy the application state objects to the
new domain, they would all have to be serializable (to marshal across domain
boundries), which currently is not a requirement for application objects.

what is guanenteeded is that the application start routine will be called
before any request.

-- bruce (sqlwork.com)
 
Thanks for the response.

It sounds like you're saying that the dot net isapi filter only creates
another app domain for an application if there is a change to the
application code, and in that case it would ultimately destroy the
initial app domain.

Is that correct?
 
Yes, that is almost exactly what Bruce wrote. In addition, AppPools can be
recycled in IIS 6.0 because of excessive memory usage and other factors.
Unhandled exceptions can also bring down an appDomain.
In IIS 6.0 AppPool behavior is user-configurable. However normally there
would not be more than one active appdomain for a single instance of an IIS
ASP.NET application.
 
Back
Top