简体   繁体   English

.ashx图像处理程序在生产服务器上不起作用

[英].ashx image handler not working on production server

I developed a little .ashx handler that returns an image so I could do 我开发了一个小.ashx处理程序,它返回一个图像,因此我可以

<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. 我将其移至生产服务器(Server 2008上的IIS),但它坏了。 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. 事件日志中没有错误,并且IIS日志说它以200 / OK响应。 I'm a little lost as to how I should go about debugging this further. 关于如何进一步调试它,我有些困惑。

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. 我的开发环境与生产服务器之间的差异导致需要双重转义一个.NET可以正常使用但我的外部程序特别解释的特殊字符。 The entire problem was unrelated to the handler. 整个问题与处理程序无关。

Thanks for the help, though. 不过,感谢您的帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM