Question

I am trying to run a standard SubText blog engine as a sub application to a standard MS MVC website. The Web.configs have conflicting entries. I know there is some way to limit the scope of these entries in the web.config, but I have yet to make it work. Any ideas? I tried using a <location> tag but it cannot exist at a root xml level. Trying to use <remove> statements seem to be simply ignored. The details:

The sub app error:

Section or group name 'system.web.extensions' is already defined. Updates to this may only occur at the configuration level where it is defined.

The sub app code:

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

The parent app code:

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

Solution

What is stopping you from deleting that sectionGroup in the sub app config? Should work fine that way...?

If that breaks something, try adding a runtime assembly redirect for System.Web.Extensions:

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
            <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
            <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
        </dependentAssembly>
    </assemblyBinding>
</runtime>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top