如何配置 ELMAH 以与 Windows Azure 一起使用? 我在 Elmah.axd 上收到 404
我有一个在 Windows Azure 上运行的 ASP.NET MVC Web 角色,并在 web.config 中正确设置了 ELMAH。 我也有我的 global.asax 忽略 *.axd 路线。 在本地,我可以加载 /elmah.axd,但是当我部署到 Azure 时,我在该页面上收到 404。 有人让 ELMAH 在 Azure 上工作吗?
I have an ASP.NET MVC web role running on Windows Azure and have setup ELMAH properly in the web.config. I also have my global.asax ignore *.axd routes. Locally, I am able to load /elmah.axd, however when I deploy to Azure, I get a 404 on that page. Has anyone gotten ELMAH working on Azure?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Azure 基于 Windows Server 2008 和 IIS7。 这意味着您需要填充 web.config 文件的 system.webServer 部分。
elmah 源代码中包含的示例文件包含您需要输入的详细信息。
上面的 xml 块中有 2 行 elmah 行,您需要包含这些元素,并且该部分一般应包含大多数(如果不是全部)这些元素反正。
编辑:不再需要,因为现在默认启用:
要使 Elmah 正常工作,您还需要修改 ServiceDefinition.csdef 文件中的以下行:
Azure is based on Windows Server 2008 and IIS7. This means that you need to populate the system.webServer part of the web.config file.
The sample file included with elmah's source code contains the details that you need to put in.
There are 2 elmah lines in the above block of xml that you will need to include, and the section in general should contain most if not all of those elements anyway.
EDIT: No longer required as this is now on by default:
For Elmah to work you will also need to modify the following line in your ServiceDefinition.csdef file:
还要保护文件,以便只有允许的用户才能查看错误日志!
Also secure the file so only allowed users can view the error logs!
我认为另外(对于@mat1t )您可能需要将远程访问设置为 1:
I think additionally (to what suggested by @mat1t here) you may need to set remote access to 1: