How do I stop web.config inheritance

前端 未结 3 752
借酒劲吻你
借酒劲吻你 2020-12-09 21:32

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 t

3条回答
  •  無奈伤痛
    2020-12-09 22:11

    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

提交回复
热议问题