- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的网站配置为在发生错误时显示自定义 HTML 页面。这在 IIS 和 ASP.NET 开发服务器上都可以正常工作。但是,当我将应用程序部署到 Windows Azure 时,对于非 ASP.NET-URL,我得到的是 HTTP 500,而不是 404。
相关的 web.config 部分如下所示:
<httpErrors errorMode="Custom">
<clear />
<error statusCode="404" path="/Public/Error404.html" responseMode="ExecuteURL" />
</httpErrors>
<customErrors defaultRedirect="/Public/Error.html" mode="On">
<error redirect="/Public/Error404.html" statusCode="404" />
</customErrors>
customErrors
部分(应用于以 .aspx 结尾的 URL)工作正常。 httpErrors
然而,该部分没有。即使 Azure 的 IIS 向浏览器发送 500,它也会记录 404:
2012-02-10 13:30:07 W3SVC1273337584 RD00155D3A1439 10.61.70.39 GET /asdfdsaafds - 80 - 65.52.128.172 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E) - - 940af2dbd9df4924b87a13878752aee3.cloudapp.net 404 0 2 222 457 218
在本地,我收到 HTTP 500.19,其中包含一些更详细的信息:
The requested page cannot be accessed because the related configuration data for the page is invalid.
Config Error Lock violation
238:
<httpErrors errorMode="Custom" defaultPath="/Public/Error.html" existingResponse="Replace" defaultResponseMode="ExecuteURL">
谷歌搜索锁定冲突对我没有太大帮助,因为结果通常告诉我有关独立 IIS 的信息。 Windows 事件日志中没有任何错误。
我想显示 Error404.html
对于 Azure 和独立 IIS 上的任何 404。任何帮助都会很棒。
最佳答案
那么,显而易见的问题是:您是否确定您的自定义错误页面实际上已部署到您的 Azure Web 角色实例?
第二个问题:它可以在 Azure 模拟器中运行吗?
更新:
该错误消息表明配置部分已锁定在您的目标 II 上。
阅读此Introduction to ApplicationHost.config 。您可能需要解锁 httpErrors 部分。
此外,请查看 this solution对于类似的错误。
关于asp.net - httpErrors 配置部分在 Windows Azure 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9229208/
今天有小伙伴给我留言问到,try{...}catch(){...}是什么意思?它用来干什么? 简单的说 他们是用来捕获异常的 下面我们通过一个例子来详细讲解下
我正在努力提高网站的可访问性,但我不知道如何在页脚中标记社交媒体链接列表。这些链接指向我在 facecook、twitter 等上的帐户。我不想用 role="navigation" 标记这些链接,因
说现在是 6 点,我有一个 Timer 并在 10 点安排了一个 TimerTask。之后,System DateTime 被其他服务(例如 ntp)调整为 9 点钟。我仍然希望我的 TimerTas
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我就废话不多说了,大家还是直接看代码吧~ ? 1
Maven系列1 1.什么是Maven? Maven是一个项目管理工具,它包含了一个对象模型。一组标准集合,一个依赖管理系统。和用来运行定义在生命周期阶段中插件目标和逻辑。 核心功能 Mav
我是一名优秀的程序员,十分优秀!