Professional Web Applications Themes

Multiple web.config files in a virtual directory - ASP.NET Security

Is it possible to have multiple web.config files in a given virtual directory in different directories? For example: [url]http://localhost/myapp[/url] (Virtual directory maps to C:\MyApp) [url]http://localhost/myapp/newFolder[/url] (web folder in the above virtual dir maps to C:\MyApp\NewFolder) Can I have one web.config file at C:\MyApp and another at C:\MyApp\NewFolder? When I tried to do this, VS.NET web project (during debugging) throws an errors saying that something is wrong at the server? So I compiled the project and tried to bring to navigate to a page in the browser (without debugging), I still get an error. But when I remove the web.config file ...

  1. #1

    Default Multiple web.config files in a virtual directory

    Is it possible to have multiple web.config files in a given virtual
    directory in different directories? For example:

    [url]http://localhost/myapp[/url] (Virtual directory maps to C:\MyApp)
    [url]http://localhost/myapp/newFolder[/url] (web folder in the above virtual dir maps
    to C:\MyApp\NewFolder)

    Can I have one web.config file at C:\MyApp and another at
    C:\MyApp\NewFolder? When I tried to do this, VS.NET web project (during
    debugging) throws an errors saying that something is wrong at the server? So
    I compiled the project and tried to bring to navigate to a page in the
    browser (without debugging), I still get an error. But when I remove the
    web.config file at C:\MyApp\NewFolder, it works fine.

    Any help is appreciated.

    Thanks.
    Raghu/..


    Raghu Guest

  2. #2

    Default Re: Multiple web.config files in a virtual directory

    yes, but you are limited what can be in the second one... usually thought
    its better to have the ONE in the root and use the <location> tags to
    explicitely handle things in the subfolders

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    Site: [url]http://www.Darkfalz.com[/url]
    Blog: [url]http://blog.Darkfalz.com[/url]


    "Raghu" <Raghunospamzzzqcsi.com> wrote in message
    news:uii1o$$QEHA.1312TK2MSFTNGP12.phx.gbl...
    > Is it possible to have multiple web.config files in a given virtual
    > directory in different directories? For example:
    >
    > [url]http://localhost/myapp[/url] (Virtual directory maps to C:\MyApp)
    > [url]http://localhost/myapp/newFolder[/url] (web folder in the above virtual dir maps
    > to C:\MyApp\NewFolder)
    >
    > Can I have one web.config file at C:\MyApp and another at
    > C:\MyApp\NewFolder? When I tried to do this, VS.NET web project (during
    > debugging) throws an errors saying that something is wrong at the server?
    So
    > I compiled the project and tried to bring to navigate to a page in the
    > browser (without debugging), I still get an error. But when I remove the
    > web.config file at C:\MyApp\NewFolder, it works fine.
    >
    > Any help is appreciated.
    >
    > Thanks.
    > Raghu/..
    >
    >

    Curt_C [MVP] Guest

  3. #3

    Default Re: Multiple web.config files in a virtual directory

    "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    news:udY9AGAREHA.3612TK2MSFTNGP10.phx.gbl...
    > yes, but you are limited what can be in the second one... usually thought
    > its better to have the ONE in the root and use the <location> tags to
    > explicitely handle things in the subfolders
    Curt, what are the limitations on the web.config in the subfolder?

    The only limitation I'm aware of is an issue with assembly references if the
    sub-folder is also an application. If the main web.config uses

    <httpModules>
    <add name="MyModule" type="MyNamespace.MyModule, MyAssembly" />
    </httpModules>

    Then the subapplication will be looking for a SubApp\bin\MyAssembly.dll. You
    can add a <remove name="MyModule" /> to the sub-web.config, but it's already
    too late - ASP.NET will be looking for MyAssembly.dll before it gets around
    to processing your <remove>. The workaround is to place a dummy
    MyAssembly.dll in SubApp\bin.
    --
    John Saunders
    johnwsaundersiii at hotmail


    John Saunders Guest

  4. #4

    Default Re: Multiple web.config files in a virtual directory

    Are you saying the SUB is flagged as an APP in VS?

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    Site: [url]http://www.Darkfalz.com[/url]
    Blog: [url]http://blog.Darkfalz.com[/url]


    "John Saunders" <johnwsaundersiiinotcoldmail.com> wrote in message
    news:%23qLDO1AREHA.3124TK2MSFTNGP12.phx.gbl...
    > "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    > news:udY9AGAREHA.3612TK2MSFTNGP10.phx.gbl...
    > > yes, but you are limited what can be in the second one... usually
    thought
    > > its better to have the ONE in the root and use the <location> tags to
    > > explicitely handle things in the subfolders
    >
    > Curt, what are the limitations on the web.config in the subfolder?
    >
    > The only limitation I'm aware of is an issue with assembly references if
    the
    > sub-folder is also an application. If the main web.config uses
    >
    > <httpModules>
    > <add name="MyModule" type="MyNamespace.MyModule, MyAssembly" />
    > </httpModules>
    >
    > Then the subapplication will be looking for a SubApp\bin\MyAssembly.dll.
    You
    > can add a <remove name="MyModule" /> to the sub-web.config, but it's
    already
    > too late - ASP.NET will be looking for MyAssembly.dll before it gets
    around
    > to processing your <remove>. The workaround is to place a dummy
    > MyAssembly.dll in SubApp\bin.
    > --
    > John Saunders
    > johnwsaundersiii at hotmail
    >
    >

    Curt_C [MVP] Guest

  5. #5

    Default Re: Multiple web.config files in a virtual directory

    oopss... I mean IIS, not VS

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    Site: [url]http://www.Darkfalz.com[/url]
    Blog: [url]http://blog.Darkfalz.com[/url]


    "John Saunders" <johnwsaundersiiinotcoldmail.com> wrote in message
    news:%23qLDO1AREHA.3124TK2MSFTNGP12.phx.gbl...
    > "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    > news:udY9AGAREHA.3612TK2MSFTNGP10.phx.gbl...
    > > yes, but you are limited what can be in the second one... usually
    thought
    > > its better to have the ONE in the root and use the <location> tags to
    > > explicitely handle things in the subfolders
    >
    > Curt, what are the limitations on the web.config in the subfolder?
    >
    > The only limitation I'm aware of is an issue with assembly references if
    the
    > sub-folder is also an application. If the main web.config uses
    >
    > <httpModules>
    > <add name="MyModule" type="MyNamespace.MyModule, MyAssembly" />
    > </httpModules>
    >
    > Then the subapplication will be looking for a SubApp\bin\MyAssembly.dll.
    You
    > can add a <remove name="MyModule" /> to the sub-web.config, but it's
    already
    > too late - ASP.NET will be looking for MyAssembly.dll before it gets
    around
    > to processing your <remove>. The workaround is to place a dummy
    > MyAssembly.dll in SubApp\bin.
    > --
    > John Saunders
    > johnwsaundersiii at hotmail
    >
    >

    Curt_C [MVP] Guest

  6. #6

    Default Re: Multiple web.config files in a virtual directory

    I meant _if_ the sub is flagged as an app. The issue I raised only happens
    if the sub is an app.
    --
    John Saunders
    johnwsaundersiii at hotmail


    "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    news:%23BjVsQBREHA.568TK2MSFTNGP12.phx.gbl...
    > oopss... I mean IIS, not VS
    >
    > --
    > Curt Christianson
    > Owner/Lead Developer, DF-Software
    > Site: [url]http://www.Darkfalz.com[/url]
    > Blog: [url]http://blog.Darkfalz.com[/url]
    >
    >
    > "John Saunders" <johnwsaundersiiinotcoldmail.com> wrote in message
    > news:%23qLDO1AREHA.3124TK2MSFTNGP12.phx.gbl...
    > > "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    > > news:udY9AGAREHA.3612TK2MSFTNGP10.phx.gbl...
    > > > yes, but you are limited what can be in the second one... usually
    > thought
    > > > its better to have the ONE in the root and use the <location> tags to
    > > > explicitely handle things in the subfolders
    > >
    > > Curt, what are the limitations on the web.config in the subfolder?
    > >
    > > The only limitation I'm aware of is an issue with assembly references if
    > the
    > > sub-folder is also an application. If the main web.config uses
    > >
    > > <httpModules>
    > > <add name="MyModule" type="MyNamespace.MyModule, MyAssembly" />
    > > </httpModules>
    > >
    > > Then the subapplication will be looking for a SubApp\bin\MyAssembly.dll.
    > You
    > > can add a <remove name="MyModule" /> to the sub-web.config, but it's
    > already
    > > too late - ASP.NET will be looking for MyAssembly.dll before it gets
    > around
    > > to processing your <remove>. The workaround is to place a dummy
    > > MyAssembly.dll in SubApp\bin.
    > > --
    > > John Saunders
    > > johnwsaundersiii at hotmail
    > >
    > >
    >
    >

    John Saunders Guest

  7. #7

    Default Re: Multiple web.config files in a virtual directory

    Ah, yes. IF it's an "app" then all bets are off.
    If it's not there are some things, like the security model/type that can't
    be "re-set" in a sub web.config, only once in the root one.

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    Site: [url]http://www.Darkfalz.com[/url]
    Blog: [url]http://blog.Darkfalz.com[/url]


    "John Saunders" <johnwsaundersiiinotcoldmail.com> wrote in message
    news:O5R$rfBREHA.252TK2MSFTNGP10.phx.gbl...
    > I meant _if_ the sub is flagged as an app. The issue I raised only happens
    > if the sub is an app.
    > --
    > John Saunders
    > johnwsaundersiii at hotmail
    >
    >
    > "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    > news:%23BjVsQBREHA.568TK2MSFTNGP12.phx.gbl...
    > > oopss... I mean IIS, not VS
    > >
    > > --
    > > Curt Christianson
    > > Owner/Lead Developer, DF-Software
    > > Site: [url]http://www.Darkfalz.com[/url]
    > > Blog: [url]http://blog.Darkfalz.com[/url]
    > >
    > >
    > > "John Saunders" <johnwsaundersiiinotcoldmail.com> wrote in message
    > > news:%23qLDO1AREHA.3124TK2MSFTNGP12.phx.gbl...
    > > > "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    > > > news:udY9AGAREHA.3612TK2MSFTNGP10.phx.gbl...
    > > > > yes, but you are limited what can be in the second one... usually
    > > thought
    > > > > its better to have the ONE in the root and use the <location> tags
    to
    > > > > explicitely handle things in the subfolders
    > > >
    > > > Curt, what are the limitations on the web.config in the subfolder?
    > > >
    > > > The only limitation I'm aware of is an issue with assembly references
    if
    > > the
    > > > sub-folder is also an application. If the main web.config uses
    > > >
    > > > <httpModules>
    > > > <add name="MyModule" type="MyNamespace.MyModule, MyAssembly" />
    > > > </httpModules>
    > > >
    > > > Then the subapplication will be looking for a
    SubApp\bin\MyAssembly.dll.
    > > You
    > > > can add a <remove name="MyModule" /> to the sub-web.config, but it's
    > > already
    > > > too late - ASP.NET will be looking for MyAssembly.dll before it gets
    > > around
    > > > to processing your <remove>. The workaround is to place a dummy
    > > > MyAssembly.dll in SubApp\bin.
    > > > --
    > > > John Saunders
    > > > johnwsaundersiii at hotmail
    > > >
    > > >
    > >
    > >
    >
    >

    Curt_C [MVP] Guest

Similar Threads

  1. Web Server Config tool not seeing IIS6 virtual site.
    By theMex in forum Coldfusion Server Administration
    Replies: 0
    Last Post: August 5th, 07:39 PM
  2. j2ee config and virtual hosts
    By kylewright in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: June 7th, 06:42 PM
  3. Replies: 0
    Last Post: August 12th, 08:07 PM
  4. Web.Config and Virtual Directory
    By Wm. Scott Miller in forum ASP.NET Security
    Replies: 1
    Last Post: June 9th, 10:37 AM
  5. Replies: 6
    Last Post: October 31st, 02:34 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139