Multiple web.config files in a virtual directory

Ask a Question related to ASP.NET Security, Design and Development.

  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. Similar Questions and Discussions

    1. Web Server Config tool not seeing IIS6 virtual site.
      I dont know if I am posting in the right place but am working on CF High availiability using multiple CF instances connected to different virtual...
    2. j2ee config and virtual hosts
      I'm attempting to use the j2ee configuration of mx7 and am having difficulty determining how I can setup virtual hosts. I am using tomcat and can...
    3. Are application web.config files cumulative when there are multiple applications?
      Hi, For a web application if I have various <location> authorizations set in the web.config file in the root directory and then also have another...
    4. Web.Config and Virtual Directory
      We have a intranet site that allows one of our departments to search a set of pdfs and then look at them. Only problem is that only they and us...
    5. config file: a) what Module ? b) conditionals in config (for multiple hosts)
      Hi, a) I am looking for a module to handle config files. There are a number of these modules, like AppCconig. Any consensus about The Right...
  3. #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" <Raghu@nospamzzzqcsi.com> wrote in message
    news:uii1o$$QEHA.1312@TK2MSFTNGP12.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

  4. #3

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

    "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    news:udY9AGAREHA.3612@TK2MSFTNGP10.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

  5. #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" <johnwsaundersiii@notcoldmail.com> wrote in message
    news:%23qLDO1AREHA.3124@TK2MSFTNGP12.phx.gbl...
    > "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    > news:udY9AGAREHA.3612@TK2MSFTNGP10.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. #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" <johnwsaundersiii@notcoldmail.com> wrote in message
    news:%23qLDO1AREHA.3124@TK2MSFTNGP12.phx.gbl...
    > "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    > news:udY9AGAREHA.3612@TK2MSFTNGP10.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

  7. #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.568@TK2MSFTNGP12.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" <johnwsaundersiii@notcoldmail.com> wrote in message
    > news:%23qLDO1AREHA.3124@TK2MSFTNGP12.phx.gbl...
    > > "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    > > news:udY9AGAREHA.3612@TK2MSFTNGP10.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

  8. #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" <johnwsaundersiii@notcoldmail.com> wrote in message
    news:O5R$rfBREHA.252@TK2MSFTNGP10.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.568@TK2MSFTNGP12.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" <johnwsaundersiii@notcoldmail.com> wrote in message
    > > news:%23qLDO1AREHA.3124@TK2MSFTNGP12.phx.gbl...
    > > > "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    > > > news:udY9AGAREHA.3612@TK2MSFTNGP10.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

Posting Permissions

  • You may not post new threads
  • You may 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