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

发布于 2024-07-13 13:55:30 字数 303 浏览 8 评论 0原文

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

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

但它给了我“500 内部服务器错误”。 当我删除上述标签后,我的网站就可以正常工作了。 谁能猜出为什么会造成这个问题?

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>

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??

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

兮子 2024-07-20 13:55:30

明白了,伙计们:)

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

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

将所有模块放在此处,就完成了! 它很好而且工作完美!

而“@Jon Skeet”不需要模块的命名空间,即使没有命名空间你也可以让它工作!

请在此处阅读有关此标记的更多信息 http://www.iis.net/ConfigReference/system。网络服务器/模块

Got it guys :)

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!

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

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

为人所爱 2024-07-20 13:55:30

什么是WwwSubDomainModule? 我强烈怀疑您需要指定命名空间以及可能的程序集名称。 如果您打开详细错误日志记录,它也应该为您提供更多信息。

What is WwwSubDomainModule? I strongly suspect you need to specify the namespace and possibly the assembly name. If you turn verbose error logging on, it should give you more information too.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文