web.config 忽略 httpmodules 部分

发布于 2024-10-08 01:22:30 字数 684 浏览 0 评论 0原文

我正在尝试将自定义 httpmodule 添加到相当大的 .NET 应用程序中 web.config 的 httpModules 部分。

在我添加该模块后,该模块似乎并没有真正受到攻击。

一时兴起,我将其中一个默认模块更改为错误,看看会发生什么:

这:

<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

变成了这样:

<add name="ScriptModule" type="Blah.Blah.Blah, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

应用程序仍然有效!它编译并运行良好......不知何故。如果我从头开始创建一个新的网络应用程序并进行相同的更改,它会按预期中断。

这怎么可能?我绝对肯定它是正确的 web.config。如果我故意破坏它的其他部分(或将标签更改为偶数),应用程序会像它应该的那样抛出错误。

I am trying to add a custom httpmodule to the httpModules section of a web.config in a rather large .NET app.

The module did not seem to actually be getting hit after I added it.

On a whim, I changed one of the default modules to be wrong to see what happens:

This:

<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

Became this:

<add name="ScriptModule" type="Blah.Blah.Blah, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

The app still works! It compiles and runs fine...somehow. If I create a new web app from scratch and make the same change it breaks as expected.

How is this possible? I am absolutely positive that it is the right web.config. If I purposely break other parts of it(or change the tag to even) the app throws an error like it should.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文