Zhixian's Tech Blog

2012-12-07

ASP.NET application restarts on every request

Filed under: web application development — Tags: , , , — Zhixian @ 09:00:12 am

Lately I have been struggling with a very strange issue in one of my ASP.NET projects.

For some strange reason, the application would perform a recompilation on every request.
Having the recompilation means that the application needs to be restarted.
What this effectively means, is that the application will not be snappy as it should be as it will be going through the application life-cycle.

Interestingly, the shutdown reason provided by System.Web.Hosting.HostingEnvironment.ShutdownReason is BuildManagerChange.
Unfortunately, what MSDN has to say about this is:

The compilation system shut the application domain.
The BuildManagerChange member is introduced in the .NET Framework version 3.5.

What’s worse for me is that this topic of BuildManagerChange appears to be relatively uncharted territory.
Either no one has come across this issue or I’m one of the first developers to come across this issue or I’m using the wrong keywords to find resources regarding this topic.

To cut the long story short, I finally come to the conclusion that this is an infrastructure issue, specifically with IISEXPRESS 8.0 which is a bit of a disappointment because I really like developing using IISEXPRESS.
This conclusion was reached by virtue that the problem disappears when I:

  1. Use IIS (7.5, the default for my WIndows 7 machine)
  2. Use the web development server instead of IISEXPRESS
  3. Use IISEXPRESS 7.5 (inconclusive!)

I could not reach to a happy conclusion with point 3. The reason being that when you install IISEXPRESS 8.0, it will effective replace IISEXPRESS 7.5
So when I say “use IISEXPRESS 7.5”, it implies that I’m using a different machine. Since it’s a different machine, there would be tons of probable variables that may result the application in working. Hence, inconclusive.

But point 1 and 2 are good enough reasons for me to lay the blame at IISEXPRESS 8.0
So if you are encountering application restarts for no apparent reason on IISEXPRESS, try it with IIS 7.5

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: