How can I merge these two web.config files?

2019-09-02 20:06发布

问题:

I have 2 web.config files -- one in my root and one in my /knowledgebase/ directory -- which I have converted to an application in IIS7.

Nevertheless, I still get the: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. C:\Users\Owner\Documents\Visual Studio 2010\WebSites\USS\knowledgebase\web.config 35

My /knowledgebase/ web.config line 35-38 is:

    <authentication mode="Forms">
    <forms name=".YAFNET_Authentication" protection="All" timeout="43200"   
     cookieless="UseCookies"/>
     </authentication>

Which I'm sure conflicts with my root web.config, which is:

    <authentication mode="Windows">
        <forms loginUrl="~/knowledgebase/" timeout="2880" />
    </authentication>

I'm having the same issues with authentication as I am with roleManager. Since converting the directory to an application in IIS7 didn't work is it possible to merge these web.configs? If so how would I go about doing so? Thanks!

Addendum: Here's a snapshot of my IIS7, which (to me) clearly shows it's an application: