且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

“500 内部服务器错误"在我的网站中添加 HttpModule 时?

更新时间:2021-08-30 08:14:15

知道了 :)

自 2008 年 10 月以来我一直面临这个问题,但最后我明白了,为什么?不要像我在上面的问题中添加的那样添加模块,而是使用为 IIS7 制作的以下新模块语法(godaddy 正在使用 IIS7 进行 Windows 托管)

I was facing this problem since last October 2008, but finally I got this why? Instead of adding modules like I have added above in my question, use the following new module syntax made for IIS7 (godaddy is using IIS7 for windows hosting)

<configuration>
   <system.webServer>
      <modules>
         <add name="Header" type="Contoso.ShoppingCart.Header"/>
      </modules>
   </system.webServer>
</configuration>

把你所有的模块都放在这里,你就完成了!很好,效果很好!

Place all your modules under here and you're done! It's nice and works perfect!

而@Jon Skeet"不需要为模块提供命名空间,即使没有命名空间你也可以让它工作!

And "@Jon Skeet" there is no need to have namespace for modules, even without namespace you can get it work!

在此处阅读有关此标签的更多信息 http://www.iis.net/ConfigReference/system.webServer/modules

Do read more about this tag here http://www.iis.net/ConfigReference/system.webServer/modules