|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Web.Config file seems to be ignoredI 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 If your subdir is an application or virtual dir, it won't inherit the
settings from the parent web.config. karl Show quoteHide quote "Bill Long" <BillL***@discussions.microsoft.com> wrote in message news:404B0E5D-B82D-45D0-BEFA-F7AC217788AC@microsoft.com... > 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 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". -- Show quoteHide quoteBill "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" <BillL***@discussions.microsoft.com> wrote in message > news:404B0E5D-B82D-45D0-BEFA-F7AC217788AC@microsoft.com... > > 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 > > > 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 Show quoteHide quote "Bill Long" <BillL***@discussions.microsoft.com> wrote in message news:CB657263-5876-43E5-B702-4059454ECE04@microsoft.com... > 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" <BillL***@discussions.microsoft.com> wrote in message >> news:404B0E5D-B82D-45D0-BEFA-F7AC217788AC@microsoft.com... >> > 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 >> >> >> 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 -- Show quoteHide quoteBill "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
Other interesting topics
|
|||||||||||||||||||||||