.ashx 图像处理程序无法在生产服务器上运行
我开发了一个小的 .ashx 处理程序,它返回一个图像,这样我就可以
<img src="myhandler.ashx?query=string">
在我的开发机器上完美运行。我将其移至生产服务器(Server 2008 上的 IIS),但它崩溃了。我所说的“损坏”是指它不再返回有效的图像。处理程序调用外部应用程序来生成图像 - 我的路径错误,修复了它,完成的就是使警告停止显示在事件日志中。
我知道它有运行该程序的权限。我手动运行了我传递的命令并成功生成了图像。事件日志中没有错误,IIS 日志显示它以 200/OK 响应。我对应该如何进一步调试这个有点迷失。
I developed a little .ashx handler that returns an image so I could do
<img src="myhandler.ashx?query=string">
It worked perfectly on my dev machine. I moved it to the production server (IIS on Server 2008) and it broke. By "broke", I mean it no longer returns a valid image. The handler calls an external application to generate the image - I had the path wrong, fixed it, and all that accomplished was to make the warnings stop showing up in the event log.
I know it has permission to run the program. I manually ran the command I'm passing it and successfully generated an image. There are no errors in the event log and the IIS log says it responds with a 200/OK. I'm a little lost as to how I should go about debugging this further.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所以,解决了。
我的开发环境和生产服务器之间的差异导致需要对 .NET 可以使用但我的外部程序专门解释的特殊字符进行双重转义。整个问题与处理程序无关。
不过还是谢谢你的帮助。
So, got it solved.
The discrepancies between my dev environment and the production server led to the need to double-escape a special character that .NET is fine with but my external program interprets specially. The entire problem was unrelated to the handler.
Thanks for the help, though.