3

I have a parent application hosted in the root folder of my website. It's a .NET 4.0 application and the application pool is obviously set to 4.0.

I want to configure a child application at:

/blog

This is a .NET 2.0 application (it's BlogEngine.NET). I created a new virtual directory called "blog", pointed it at the appropriate directory, converted it to an application and put it in it's own application pool set to .NET Framework 2.0.

I edited the parent web.config and added:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
      <configSections>
         <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
    </configSections>
  ....entire web.config basically...
  </location>
</configuration>

Right after the element. However, when I go to http://localhost/blog, I get the following error:

The configuration section 'configSections' cannot be read because it is missing a section declaration

Anyone have any ideas what's going on here or what I might be missing?

Scott
  • 13,735
  • 20
  • 94
  • 152

2 Answers2

2

Unfortunately this is a downfall of the way IIS handles virtual directories. Your parent application's web.config is still read even though it's not in the child application. I tried to nest a 4.0 app as a child of a 3.5 app before and after several days of frustration, SO questions, and forum posts, I finally came to the conclusion that it was more trouble than it was worth.

CatDadCode
  • 58,507
  • 61
  • 212
  • 318
0

Why don't you just upgrade BlogEngine to Asp.net 4.0 ?

Download the BE 2.0 Web version open it up in Visual Studio it will ask "Would you like it 4.0?" Say yes then it targets the web.config for you.

You can then just upload the new web.config to your server.

If you have an old BE version then you might want to upgrade it to the last stable release.

Kbdavis07
  • 1,012
  • 13
  • 24