« Previous Next »

Not Answered Thread: Overriding Root Web Config File (EL 3.1 and 2.0)

Last post 09-15-2010 12:49 PM by jfkrueger. 14 replies.

 

RSS

Page 1 of 1 (15 items)

Sort Posts:

  • 02-16-2009, 7:45 AM

    • MejeeR
    • Not Ranked
    • Joined on 02-16-2009, 12:22 PM
    • Posts 6

    Overriding Root Web Config File (EL 3.1 and 2.0)

    Hello, we already have this Root Web App that is configured via Enterprise Library 2.0 and there is this new application that was decided to be a Sub Web App which should run on the same DNS, the problem is that it is configured via Enterprise Library 3.1.

    Several configuration sections such as logging, exception handling and data configuration block are already present on the root web config thus, the latest one is encountering concerns.

    Parser Error Message: Section or group name 'loggingConfiguration' is already defined. Updates to this may only occur at the configuration level where it is defined.

    We have already tried, the <remove> and <clear> methods but niether of which work wonders. I've also read about the EL DLL modification but for our case this is not advisable since the EL is shared on multiple other applications within the box.

    In short note, is there any other way for the sub web application not to inherit the web.config of the root web application?

    ** Our last resort is to create a seperate web site.

  • 02-16-2009, 8:13 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 10:27 AM
    • Central NJ
    • Posts 7,651
    • IIS MVPs

    Re: Overriding Root Web Config File (EL 3.1 and 2.0)

    It's not clear - is the folder for this set as an application in the IIS MMC?

  • 02-16-2009, 8:36 AM In reply to

    • MejeeR
    • Not Ranked
    • Joined on 02-16-2009, 12:22 PM
    • Posts 6

    Re: Overriding Root Web Config File (EL 3.1 and 2.0)

    My apologies and thanks for the reply.

    The Root Web Application is deployed as D:\WebApplication and on IIS 6.0 it is a WebSite. It has its own pages and bin folder within. So the URL for its page for example is https://webapp.com/default.aspx

    The Sub Web Application is deployed as D:\WebApplication\SubWebApplication under the same IIS but just a virtual directory. It also has its own pages and bin folder. So the URL for its page for example is https://webapp.com/subwebapplication/default.aspx

    We believe that the inheritance of the config file is causing us the problem which we do not have a clear idea with how to solve.

    Thanks a lot

  • 02-16-2009, 11:51 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 10:27 AM
    • Central NJ
    • Posts 7,651
    • IIS MVPs

    Re: Overriding Root Web Config File (EL 3.1 and 2.0)

    MejeeR:
    The Sub Web Application is deployed as D:\WebApplication\SubWebApplication under the same IIS but just a virtual directory.

    So then the answer to "is the folder for this set as an application in the IIS MMC?" is "No".

    Set the "SubWebApplication" folder as an application.  That will change the scope so it's own web.config is used.

  • 02-17-2009, 12:45 AM In reply to

    • MejeeR
    • Not Ranked
    • Joined on 02-16-2009, 12:22 PM
    • Posts 6

    Re: Overriding Root Web Config File (EL 3.1 and 2.0)

    I see, so from my understanding creating the "SubWebApplication" as a new Web Site under the IIS would only be the resolution. 

    Do you mean that we need to setup another DNS and IP or just use the old IP provided we use a different port to make it work?

    My apologies, I'm quite new on this particular field.

  • 02-17-2009, 7:46 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 10:27 AM
    • Central NJ
    • Posts 7,651
    • IIS MVPs

    Re: Overriding Root Web Config File (EL 3.1 and 2.0)

  • 02-18-2009, 4:28 AM In reply to

    • MejeeR
    • Not Ranked
    • Joined on 02-16-2009, 12:22 PM
    • Posts 6

    Re: Overriding Root Web Config File (EL 3.1 and 2.0)

    Hello Tom, yes its also the configuration we did, its a new Virtual Directory / Application and also has a different application pool but still when we hit the url it looks for the root web config first before looking to its own web config. In return the error message says that the configsection has already been declared by the root web config.

  • 02-18-2009, 8:35 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 10:27 AM
    • Central NJ
    • Posts 7,651
    • IIS MVPs

    Re: Overriding Root Web Config File (EL 3.1 and 2.0)

  • 02-18-2009, 9:51 PM In reply to

    • MejeeR
    • Not Ranked
    • Joined on 02-16-2009, 12:22 PM
    • Posts 6

    Re: Overriding Root Web Config File (EL 3.1 and 2.0)

    Hi Tom yes I did, I also have the same post but nobody could reply.

    Nontheless, thanks for the advices, we will still try to look for answer on this and update this thread of the final decision / action we took. Thanks again

  • 02-21-2009, 2:44 AM In reply to

    Re: Overriding Root Web Config File (EL 3.1 and 2.0)

    Hi,

    MejeeR:
    In short note, is there any other way for the sub web application not to inherit the web.config of the root web application?

    You can add the <location> element with the “inheritInChildApplications” attribute to the root web.config. This attribute will prevent child applications inherit some specified configuration from the root web.config.

    The attribute must be placed in the <configuration> section of the web.config. It looks like this:
    <location inheritInChildApplications="false">
    <system.web>
     <!--
         ……
         Your settings

      -->
    </system.web >
    </location>

    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
  • 02-23-2009, 4:27 AM In reply to

    • MejeeR
    • Not Ranked
    • Joined on 02-16-2009, 12:22 PM
    • Posts 6

    Re: Overriding Root Web Config File (EL 3.1 and 2.0)

    We've also tried that, the problem is that <location> can only be placed right after the <configSection> part because the latter does not allow any tag above him except for the <configuration>.

    With this, <configSection> part is still nested and inheritted to the child config file.

    Thanks still for your reply :)

     

  • 03-16-2009, 1:03 PM In reply to

    Re: Overriding Root Web Config File (EL 3.1 and 2.0)

    I have this same issue, I can't believe I haven't run into it until now, unless it is a recent bug. It appears that the remove and clear child elements of configSections element are ignored. /sigh
  • 07-16-2009, 2:39 AM In reply to

    Re: Overriding Root Web Config File (EL 3.1 and 2.0)

     Adding of <location inheritInChildApplications="false"> worked for me...

    gr8.. 

     

    Thanks

  • 10-19-2009, 5:47 PM In reply to

    Re: Overriding Root Web Config File (EL 3.1 and 2.0)

    So it still looks like there is no way for a virtual diretories web.config <configSections> to not inherit from the root directories web.config.

  • 09-15-2010, 12:49 PM In reply to

    Re: Overriding Root Web Config File (EL 3.1 and 2.0)

    That's kind of what it looks like. How incredibly lame. I hate that IIS automatically inherits web.config files in root directories EVEN when the directory is a Virtual Directory and an application with it's own web.config. LAME LAME LAME!

    And no, you can't use the <location> tag because <configSections> HAS to be the first tag after <configuration>. lame.

Page 1 of 1 (15 items)