views:

1508

answers:

3

Ok

I have a Asp .net 3.5 Website in IIS6 on Windows Server 2003 (32bit).

with a Asp.Net 1.1 WebApplication in a sub virtual directory. (this is set to use the older 1.1 .net runtime and is configured with it's own App Pool. So for all intents and purposes is completely seperate.

Except it keeps on inheriting the root website's .net 3.5 web.config.

I've tried adding

<location path="." inheritInChildApplications="false">

to the root websites web.config but it doesn't seem to work.

Strangely the error is actually

<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

which is being reported from the .net 1.1 runtime with the website path WEBSITE/OLD_WEBAPP but it's moaning about the webSite (as in the .net 3.5 one's) web.config and how it doesn't understand the type attribute on the sectionGroup tag.

What am I doing wrong? Please tell me it's something obvious. Thanks

A: 

Most of the sections in Web.config can have a tag added to them - it might be worth adding this to the affected sections to see if it solves your inheritance probem (see http://stackoverflow.com/questions/783732/is-it-possible-to-completely-negate-a-higher-web-config-in-a-subfolder for some caveats to watch out for).

Ian Oxley
+2  A: 
<location path="." inheritInChildApplications="false">
  <system.web>
    ...
  </system.web>
</location>
Kyle B.
Also, be sure you have created a "Virtual Directory" for the sub-folder within IIS.
Kyle B.
That only works if parent and child are .NET 2.0 applications.
Adam Sills
... and only makes a difference if it's something inside system.web that's causing problems. The question said it's listing a sectionGroup element in the error, which won't be fixed by this.
Adam Sills
As Adam Sills says only works if both parent and child are .net 2.0 unfortunately for me my childs .net 1.1
danswain
A: 

Just to let everyone know, I've found an answer that serves my purposes for now.

I ended up putting all the configuration in the .net 2.0 global web.config

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG

I got this suggestion from this comment on connect.microsoft.com

The configuration systems for both ASP.NET 1.1 and 2.0 are hierarchichal. As a result if a different framework version is a child of the root website (which is usually inetpub\wwwroot), then the configuration system in the child will attempt to merge the configuration from the root website. This behavior is by design since both the 1.1 and 2.0 configuration systems walk up the physical directory structure looking for parent web.configs.

A simple workaround is to move the common 2.0 configuration information to the root web.config file for the 2.0 framework. The root web.config is located at: C:\windows\Microsoft.NET\Framework\v2.0.50727\CONFIG. With this approach all of your 2.0 applications will pick up the common sections while 1.1 applications won't see the sections.

Thank you for submitting this issue. Hope the above information is useful for you.

Posted by Microsoft on 22/02/2008 at 17:35

Seems to work for me, though it's not quite as elegant as if it had been a .net 2.0 application. Hope this helps someone else.

Dan

danswain