Nested Web Config Problem

210 views
Skip to first unread message

expresso

unread,
Oct 13, 2009, 6:09:02 PM10/13/09
to Subtext
We have our main site as the root Application on our web server in IIS
7.

We created an application under that site for the subtext blog. We're
now getting the classis issue of the blog trying to inherit the
web.config settings of our parent website thus finding duplicate keys
and we can't get to the HttpModules of the blog, etc. without error in
IIS.

So I tried out this, but we're still getting conflicts with
system.web.extensions, asp.net ajax assembly entries, etc:

http://jalukadev.blogspot.com/2009/08/prevent-webconfig-inheritance-in-nested.html

so it's still fighting to figure out which keys to use for stuff like
this:

<SsectionGroup name="scripting"
type="System.Web.Configuration.ScriptingSectionGroup,
System.Web.Extensions
...

<modules>
<add name="ScriptModule" preCondition="integratedMode"
type="System.Web.Handlers.ScriptModule, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/
>
</modules>

etc.

Phil Haack

unread,
Oct 14, 2009, 12:05:54 PM10/14/09
to sub...@googlegroups.com
For each module, try doing a remove then add.

<remove name="ScriptModule" />
<add name="ScriptModule" preCondition="integratedMode"
type="System.Web.Handlers.ScriptModule, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/

We should be doing that in our default web.config now. I'll double check later.

Phil

expresso

unread,
Oct 14, 2009, 2:56:01 PM10/14/09
to Subtext
Thanks.

So I take it there's no clear cut way to tell sub apps to ignore
inheritance. It's always going to be a manual "remove conflicting
elements" type of deal with any type of Sub applications inside a
parent in IIS.

On Oct 14, 11:05 am, Phil Haack <phi...@microsoft.com> wrote:
> For each module, try doing a remove then add.
>
> <remove name="ScriptModule" />
> <add name="ScriptModule" preCondition="integratedMode"
> type="System.Web.Handlers.ScriptModule, System.Web.Extensions,
> Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/
>
> We should be doing that in our default web.config now. I'll double check later.
>
> Phil
>
> -----Original Message-----
> From: sub...@googlegroups.com [mailto:sub...@googlegroups.com] On Behalf Of expresso
> Sent: Tuesday, October 13, 2009 3:09 PM
> To: Subtext
> Subject: [subtext] Nested Web Config Problem
>
> We have our main site as the root Application on our web server in IIS
> 7.
>
> We created an application under that site for the subtext blog.  We're
> now getting the classis issue of the blog trying to inherit the
> web.config settings of our parent website thus finding duplicate keys
> and we can't get to the HttpModules of the blog, etc. without error in
> IIS.
>
> So I tried out this, but we're still getting conflicts with
> system.web.extensions, asp.net ajax assembly entries, etc:
>
> http://jalukadev.blogspot.com/2009/08/prevent-webconfig-inheritance-i...

expresso

unread,
Oct 14, 2009, 3:18:18 PM10/14/09
to Subtext
This is also conflicting and you can't use the <remove> tag in these
sections

<!-- asp.net AJAX 1.0 config -->
<sectionGroup name="system.web.extensions"
type="System.Web.Configuration.SystemWebExtensionsSectionGroup,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="scripting"
type="System.Web.Configuration.ScriptingSectionGroup,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="webServices"
type="System.Web.Configuration.ScriptingWebServicesSectionGroup,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="jsonSerialization"
type="System.Web.Configuration.ScriptingJsonSerializationSection,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService"
type="System.Web.Configuration.ScriptingProfileServiceSection,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService"
type="System.Web.Configuration.ScriptingAuthenticationServiceSection,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>

Phil Haack

unread,
Oct 14, 2009, 3:33:24 PM10/14/09
to sub...@googlegroups.com

expresso

unread,
Oct 14, 2009, 3:37:31 PM10/14/09
to Subtext
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related
configuration data for the page is invalid.
Detailed Error Information
Module IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0x800700b7
Config Error There is a duplicate 'system.web.extensions/scripting/
webServices/jsonSerialization' section defined
Config File \\?\c:\www\sss.com\web.config
Requested URL http://sss:80/pmall/blog/
Physical Path c:\www\sss.com\
Logon Method Not yet determined
Logon User Not yet determined
Config Source
21: <sectionGroup name="webServices"
type="System.Web.Configuration.ScriptingWebServicesSectionGroup,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35">
22: <section name="jsonSerialization"
type="System.Web.Configuration.ScriptingJsonSerializationSection,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
requirePermission="false" allowDefinition="Everywhere"/>
23: <section name="profileService"
type="System.Web.Configuration.ScriptingProfileServiceSection,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKe

On Oct 14, 1:56 pm, expresso <dschin...@gmail.com> wrote:

expresso

unread,
Oct 15, 2009, 8:59:50 AM10/15/09
to Subtext
Interesting, I thought that you could only surround <system.web> only
with that tag (as I tried to move it out into a higher level in the
tree). Let me try it out under configuration thought. Thanks Phil.

On Oct 14, 2:33 pm, Phil Haack <phi...@microsoft.com> wrote:
> I found an answer to this on StackOverflow:http://stackoverflow.com/questions/782252/avoid-web-config-inheritanc...

expresso

unread,
Oct 15, 2009, 9:05:53 AM10/15/09
to Subtext
Yea, just as I thought, You can use the <location> tag to wrap lets
say <system.web> hiding the ~majority~ if the settings but not all
conflicting values are in <system.web> and some lie outside that. For
example in my previous post, that <sectionGroup> in Subtext's
web.config is causing all sorts of conflicts because it lies outside
the <system.web> node, our Parent web.config has some of those ASP.NET
references also.

When I try putting <location> just after the root node
<configuration>, IIS complains: "The requested page cannot be
accessed because the related configuration data for the page is
invalid."

expresso

unread,
Oct 27, 2009, 5:33:12 PM10/27/09
to Subtext
Resolved it. Wraped with <location> tag around system.web of parent
application. Upgraded Subtext's projects to .NET 3.5, and installed
AJAX 1.0 on server since both web configs were converted to .net 3.5
and have system.web.extension assembly references in their web.config
Reply all
Reply to author
Forward
0 new messages