Web.Config file seems to be ignored

Discussion in 'ASP .Net' started by =?Utf-8?B?QmlsbCBMb25n?=, Nov 25, 2005.

  1. Hi,

    I have a situation like this:

    wwwroot has a web.config file that adds a custom http module

    <httpModules>
    <add name="MyModue" type="MyType,MyAssembly" />
    </httpModules>

    This works wonderfully.

    Problem is I have another directory under wwwroot that has this in the
    web.config file located there.

    <httpModules>
    <remove name="MyModule" />
    </httpModules>

    If I call a page in wwwroot the http module runs and all is well. If I call
    a page in the subdirectory that I would expect the http module not to run but
    it does run.

    Any ideas in what I am doing wrong?

    --
    Bill
    =?Utf-8?B?QmlsbCBMb25n?=, Nov 25, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?QmlsbCBMb25n?=

    Karl Seguin Guest

    If your subdir is an application or virtual dir, it won't inherit the
    settings from the parent web.config.

    karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/


    "Bill Long" <> wrote in message
    news:...
    > Hi,
    >
    > I have a situation like this:
    >
    > wwwroot has a web.config file that adds a custom http module
    >
    > <httpModules>
    > <add name="MyModue" type="MyType,MyAssembly" />
    > </httpModules>
    >
    > This works wonderfully.
    >
    > Problem is I have another directory under wwwroot that has this in the
    > web.config file located there.
    >
    > <httpModules>
    > <remove name="MyModule" />
    > </httpModules>
    >
    > If I call a page in wwwroot the http module runs and all is well. If I
    > call
    > a page in the subdirectory that I would expect the http module not to run
    > but
    > it does run.
    >
    > Any ideas in what I am doing wrong?
    >
    > --
    > Bill
    Karl Seguin, Nov 25, 2005
    #2
    1. Advertising

  3. subdir is not an application or virtual Directory. It is just a plain
    directory. It seems to find it because if I introduce an error in the file...
    it complains. It just seems to ignore the "remove".

    --
    Bill


    "Karl Seguin" wrote:

    > If your subdir is an application or virtual dir, it won't inherit the
    > settings from the parent web.config.
    >
    > karl
    >
    > --
    > MY ASP.Net tutorials
    > http://www.openmymind.net/
    >
    >
    > "Bill Long" <> wrote in message
    > news:...
    > > Hi,
    > >
    > > I have a situation like this:
    > >
    > > wwwroot has a web.config file that adds a custom http module
    > >
    > > <httpModules>
    > > <add name="MyModue" type="MyType,MyAssembly" />
    > > </httpModules>
    > >
    > > This works wonderfully.
    > >
    > > Problem is I have another directory under wwwroot that has this in the
    > > web.config file located there.
    > >
    > > <httpModules>
    > > <remove name="MyModule" />
    > > </httpModules>
    > >
    > > If I call a page in wwwroot the http module runs and all is well. If I
    > > call
    > > a page in the subdirectory that I would expect the http module not to run
    > > but
    > > it does run.
    > >
    > > Any ideas in what I am doing wrong?
    > >
    > > --
    > > Bill

    >
    >
    >
    =?Utf-8?B?QmlsbCBMb25n?=, Nov 25, 2005
    #3
  4. The names match. In my first post they don't "MyModue" <> "MyModule. This is
    a typo in the post.

    In my code they match exactly case and everything
    --
    Bill


    "Bill Long" wrote:

    > Hi,
    >
    > I have a situation like this:
    >
    > wwwroot has a web.config file that adds a custom http module
    >
    > <httpModules>
    > <add name="MyModue" type="MyType,MyAssembly" />
    > </httpModules>
    >
    > This works wonderfully.
    >
    > Problem is I have another directory under wwwroot that has this in the
    > web.config file located there.
    >
    > <httpModules>
    > <remove name="MyModule" />
    > </httpModules>
    >
    > If I call a page in wwwroot the http module runs and all is well. If I call
    > a page in the subdirectory that I would expect the http module not to run but
    > it does run.
    >
    > Any ideas in what I am doing wrong?
    >
    > --
    > Bill
    =?Utf-8?B?QmlsbCBMb25n?=, Nov 25, 2005
    #4
  5. =?Utf-8?B?QmlsbCBMb25n?=

    Karl Seguin Guest

    I played with it and couldn't get it to work :(

    In the httpModule itself, you could look at the path and skip processing
    ....not an elegant solution...

    Karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/


    "Bill Long" <> wrote in message
    news:...
    > subdir is not an application or virtual Directory. It is just a plain
    > directory. It seems to find it because if I introduce an error in the
    > file...
    > it complains. It just seems to ignore the "remove".
    >
    > --
    > Bill
    >
    >
    > "Karl Seguin" wrote:
    >
    >> If your subdir is an application or virtual dir, it won't inherit the
    >> settings from the parent web.config.
    >>
    >> karl
    >>
    >> --
    >> MY ASP.Net tutorials
    >> http://www.openmymind.net/
    >>
    >>
    >> "Bill Long" <> wrote in message
    >> news:...
    >> > Hi,
    >> >
    >> > I have a situation like this:
    >> >
    >> > wwwroot has a web.config file that adds a custom http module
    >> >
    >> > <httpModules>
    >> > <add name="MyModue" type="MyType,MyAssembly" />
    >> > </httpModules>
    >> >
    >> > This works wonderfully.
    >> >
    >> > Problem is I have another directory under wwwroot that has this in the
    >> > web.config file located there.
    >> >
    >> > <httpModules>
    >> > <remove name="MyModule" />
    >> > </httpModules>
    >> >
    >> > If I call a page in wwwroot the http module runs and all is well. If I
    >> > call
    >> > a page in the subdirectory that I would expect the http module not to
    >> > run
    >> > but
    >> > it does run.
    >> >
    >> > Any ideas in what I am doing wrong?
    >> >
    >> > --
    >> > Bill

    >>
    >>
    >>
    Karl Seguin, Nov 29, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Curt_C [MVP]

    Re: web.config settings ignored

    Curt_C [MVP], Jul 28, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    353
    Curt_C [MVP]
    Jul 28, 2004
  2. Siegfried Heintze
    Replies:
    2
    Views:
    14,998
  3. Martin Herbert Dietze

    FlexeLint warning (assert seems ignored)

    Martin Herbert Dietze, Mar 2, 2007, in forum: C Programming
    Replies:
    5
    Views:
    511
  4. CSharpner
    Replies:
    0
    Views:
    1,000
    CSharpner
    Apr 9, 2007
  5. Jonny Bergdahl

    web.config ignored!?!?!

    Jonny Bergdahl, May 4, 2007, in forum: ASP .Net
    Replies:
    13
    Views:
    2,064
    Walter Wang [MSFT]
    May 23, 2007
Loading...

Share This Page