quot;500 Internal Server Errorquot; when adding HttpModule in my Website?(“500 内部服务器错误在我的网站中添加 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 内部服务器错误".当我删除上述标签时,我的网站运行正常.谁能猜出它为什么会产生这个问题??
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 制作的以下新模块语法(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
这篇关于“500 内部服务器错误"在我的网站中添加 HttpModule 时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:“500 内部服务器错误"在我的网站中添加 HttpModule 时?


基础教程推荐
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01