Running Asp.Net 4.0 Application on IIS6 under Asp.Net 2.0 Parent App

Running Asp.Net 4.0 Application on IIS6 under Asp.Net 2.0 Parent App

Phew, that title sure is a mouthful… but it is kinda hard to describe the problem in so few words.

I had just finished the primary work on a new customer’s website (http://www.BuyMyBatteries.com) and was trying to hook up the latest and greatest build of BlogEngine.Net (2.5) underneath it for the corporate blog.

The challenge, as you might have guessed is that while BE.NET requires Asp.Net 4.0, the server was running IIS 6.0 and more importantly, the parent website is running ASP.NET v2.0. Resolving this took a number steps but it appears to be working quite nicely now

Step 1

Install the application and ensure that file permissions are correct. This is a no-brainer but is an oft-overlooked step; especially if you do installs of this program regularly.

Step 2

Set the folder containing the application (in this case BlogEngine.Net) as an application and ensure that it is running in a DIFFERENT application pool than the parent’s app pool. I’ve found it to be safest to have unique app pools for every site as well as for every application but you should at minimum have a different app pool for each version of Asp.Net that you are running. The Identity of the app pool can be what ever you want but in most cases it makes sense to be Network Services in order fall in line with most install instructions.

Step 3

This is where I really had a head scratcher. When going to the application, I continued to get 404 errors even though I was certain that I had the file permissions set up correctly. As it turns out, with IIS6, just ‘cause you have Asp.Net 4.0 installed doesn’t mean it has permissions to run under the web server. If found a great solution to this in Johan Dreissen’s blog. He pointed out why this wasn’t working and more importantly, provides the command prompt to get the 4.0 version of aspnet_isapi.dll working:

Note that you’ll find the iisext.vbs script in %SYSTEMROOT%\system32.

Step 4

There is a known breaking change in Asp.Net 4.0 that, by default, prevents 4.0 apps from running as children under 2.0 or 3.5. This whitepaper on asp.net site was crucial in resolving the final mystery. By wrapping the <appSettings />, <connectionStrings /> <system.web /> <system.webServer /> and <system.codedom /> sections of the PARENT web.config file in a <location> tag, you can eliminate the compilation of the earlier version of ASP.NET from trickling down to the 4.0 application. Mine looked like this:

So, after taking the steps above, I’ve been able to run BlogEngine.Net v2.5 (an Asp.Net 4.0 application) successfully under AspDotNetStorefront v9.2.0.0 (an Asp.Net v3.5 application) as the parent application.

Have you encountered a similar problem? What was your solution? Use the comments below to share this with the rest of the class!

Stalk Me...

Michael Gibbs

I'm a technologist at heart, assisting companies best utilize the Internet to market themselves and sell their products and services online. This includes organizations as large as Google and as small as one or two individuals.
At Over The Top and Exhibit A Communications, I've programmed solutions for Google as well as at least one other company that was later acquired by Google.

I've been CTO of an Internet SaaS company and spent my time pretty evenly between guiding the future technical strategy of the company, architecting software solutions for my dev teams, designing and running a data center to service our clients world-wide as well as being a technical evangalist/sales engineer to our media clients large and small.

I've also been Chief Photographer of the Daily Sun/Post newspaper back when it was a 5-day a week daily newspaper.

I also spent a great many years as a beach lifeguardfor the City of San Clemente as well as Jr. Lifeguard instructor and then as it's program coordinator.
Bragging rights
Private Pilot with Instrument rating and proud husband of soon to be 25 years (and counting).
Stalk Me...

Latest posts by Michael Gibbs (see all)

Leave a Reply