& quot; 500内部服务器错误& quot;在我的网站中添加HttpModule时? [英] "500 Internal Server Error" when adding HttpModule in my Website?

查看:95
本文介绍了& quot; 500内部服务器错误& quot;在我的网站中添加HttpModule时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用godaddy.com注册一个网站(使用ASP.NET 2.0(C#)开发)但是,当我在我的web.config中添加HttpModule时,如下所示:

I am having a website (developed in ASP.NET 2.0 (C#)) registered with godaddy.com But when I am adding HttpModule in my web.config as follow:

<httpModules>
  <add type="WwwSubDomainModule" name="WwwSubDomainModule" />
</httpModules>

但是它给我"500 Internal Server Error".当我删除上述标签后,我的网站就可以正常工作了.谁能猜出为什么会造成这个问题?

but it gives me "500 Internal Server Error". When I removed the above tag then my website is working fine. Can anyone guess why its creating this problem??

推荐答案

帅哥:)

自2008年10月以来,我一直面临着这个问题,但是最终我明白了为什么吗?与其添加我上面在问题中添加的模块,不如使用针对IIS7的以下新模块语法(哥达迪使用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

这篇关于&amp; quot; 500内部服务器错误&amp; quot;在我的网站中添加HttpModule时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆