如何从 axd 转换为 ashx?

发布于 2024-07-09 12:00:35 字数 521 浏览 5 评论 0原文

我正在尝试部署 elmah。 由于无法解释的原因,我收到错误:.axd 文件被明确禁止。 我已经修复了我可以控制的内容(我的 web.config),并且需要系统管理员协作的解决方案可用(例如编辑计算机 web.config 或更新 IIS 映射)。 我还验证了它在其他几台普通配置的机器上运行良好。

Ashx 应该像 axd 一样,那么在从一种转换为另一种时我应该考虑 axd 和 ashx 之间有什么区别吗?

更新:我想我回答了我自己的问题。 我将 web.config 更改为“

 <add verb="POST,GET,HEAD" path="elmah.ashx" type="Elmah.ErrorLogPageFactory, Elmah" />

它似乎有效”。 elmah 的源代码中甚至没有字符串 axd。

I'm trying to deploy elmah. For inexplicable reasons, I'm getting an error: .axd files are explicitly forbidden. I've already fixed what I can control (my web.config) and solutions requiring collaboration from the system admin are not available (such as editing machine web.config or updating IIS mappings). I also verified that it works fine on several other machines with ordinary configurations.

Ashx is supposed to be like axd, so are there any differences between axd and ashx I should take into consideration when converting from one to the other?

UPDATE: I think I answered my own question. I change the web.config to read

 <add verb="POST,GET,HEAD" path="elmah.ashx" type="Elmah.ErrorLogPageFactory, Elmah" />

It seems to work. The source code for elmah doesn't even have the string axd in it.

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

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

发布评论

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

评论(2

凌乱心跳 2024-07-16 12:00:35

答案是将 web.config 更改为如下所示:

<add verb="POST,GET,HEAD" path="elmah.ashx" type="Elmah.ErrorLogPageFactory, Elmah" />

事实上,网络上的一些消息来源说,除非您是 microsoft,否则不应将任何处理程序命名为 axd ,以免与 ASP.NET 的未来版本发生名称冲突。

The answer is to change the web.config to look like this:

<add verb="POST,GET,HEAD" path="elmah.ashx" type="Elmah.ErrorLogPageFactory, Elmah" />

In fact, some source on the web say, unless you are microsoft you shouldn't name any handlers axd lest you have a name conflict with a future version of ASP.NET.

比忠 2024-07-16 12:00:35

很高兴看到您得到答案:)

axd 扩展通常用于仅使用 .NET 1.1 或更早版本的情况。 并且开发人员无权修改 IIS 6 或更早版本中允许的扩展。

在您的情况下,似乎所有跟踪都已从更高的配置级别在服务器上禁用。

您找到的答案应该可以正常工作,没有问题。

Good to see you got the answer :)

The axd extension is normally used in the cases where only .NET 1.1 or earlier is being used. And the developer does not have access to modify the extensions allowed in IIS 6 or earlier.

In your case, it seems all tracing has been disabled on the server from a higher config level.

Your answer that you find, should work correctly without issues.

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