BE 2.5 sub-folder install on ASP.NET 3.5 website

Oct 6, 2011 at 6:12 PM

I'm trying to install BE 2.5 into a sub-folder of an existing ASP.NET 3.5 website on IIS 7. I made the BE folder an application using an ASP.NET 4.0 app pool in integrated mode. All I get is a 500 error when I try to view the blog. If I remove the root website's Web.config file BE runs properly. So, I'm guessing there is some kind of conflict between the config files but I'm not getting an error messages to point me in the right direction. Help!

Oct 6, 2011 at 10:08 PM

I found this article on the ASP.NET site:

http://www.asp.net/learn/whitepapers/aspnet4/breaking-changes#0.1__Toc256770150

After experimenting with the root config file (3.5 app) it seems that the sections that are causing the issue are the ones related to the ASP.NET 3.5 extensions (System.Web.Extensions). Of course, my 3.5 app needs that so I can't just remove it. What I'm testing now is commenting these sections out and running the app in 4.0. So far this seems to work but I have not tested things extensively.

Oct 7, 2011 at 6:05 AM

Well, it looks like running the root application in ASP.NET 4.0 might not be an option. I've encountered my first compatibility problem. So, back to my original problem. Any ideas, guys?

Coordinator
Oct 7, 2011 at 1:39 PM

Generally .NET 3.5 apps can run in a .NET 4.0 pool.  You might want to try and confirm this by running the .NET 3.5 application by itself in a .NET 4.0 application pool, without having BE in the sub-folder.  If it works, which I'm thinking it will, then the best thing to do is have both the parent app and the BE subapplication both running in .NET 4.0 application pools.

It sounds like you might still be getting errors even in this case.  The next thing to do, if you haven't already is to modify the parent application's web.config file, wrapping the <system.web> and <system.webServer> sections (the latter might not exist) in <location> tags with the "inheritInChildApplications" attribute, so it looks like this:

<location path="." inheritInChildApplications="false">
        <system.web>
                   ............ existing content .............
        </system.web>
</location>

<location path="." inheritInChildApplications="false">
        <system.webServer>
                   ............ existing content .............
        </system.webServer>
</location>

This is a modification to the parent application's web.config file -- not the BE web.config file.  By wrapping the entire <system.web> and entire <system.webServer> sections in these location tags, it prevents any settings from the parent application from propagating down to the child application (BE).

It's possible you might still have errors after this, but this is a good first step.

Even if you find the .NET 3.5 application cannot run in a .NET 4.0 application pool (which is unlikely, but possible), you can still try using these <location> tags.

Oct 30, 2011 at 5:18 PM
Edited Oct 30, 2011 at 5:20 PM

I had a chance to circle back to this problem today and was able to resolve it. In the end I was able to retain the root application running in .NET 3.5 and BE running 4.0 in a sub-application. In the root application I had to wrap the <system.web>, <system.codedom>, and <system.webServer> sections in <location> tags as Ben had suggested. Additionally, I removed the sectionGroup for system.web.extensions under <configSections>.

In the BE config file I had to add a few remove lines to the <modules> section under <system.webServer> so BE wasn't trying to load modules from the root application.