如何设置在web.config中与IIS7的处理程序? [英] how to set a handler in web.config with IIS7?
问题描述
我有一个处理器上运行时,它从一个特定的文件夹中创建的图像水印。问题是,它的工作,但现在没有。
I have a handler, on runtime it create a watermark on images from a specific folder. The problem is that it worked, but now it doesn't.
所有我所做的就是改变了托管。
All that I did was to changed the hosting.
我的的web.config
是这样的:
<handler>
<add verb="*" name="ImageWatermarkHandler" type="ImageWatermarkHandler"
path="Pics/*.jpg,Pics/*.png" modules="IsapiModule"
scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll"
resourceType="Unspecified" preCondition="integratedMode" />
</handler>
您可以帮帮我吗?
推荐答案
在IIS 7,你有下指定自定义HTTP处理程序和模块配置/ system.webServer /处理器
你的web.config的元素(不像较早的IIS版本,其中的元素是配置/ System.Web程序/ HttpHandlers的
)。
Under IIS 7, you have to specify custom http handlers and modules under the configuration/system.webServer/handlers
element of your web.config (unlike older IIS versions, where the element is configuration/system.web/httpHandlers
).
有之间的集成模式的区别(你只需要处理部分)和经典模式(需要同时处理程序和HttpHandlers的)。有关详情请参见 MSDN进入
There's difference between integrated mode (you only need the handlers part) and classic mode(you need both handlers and httpHandlers). For details see the MSDN entry
编辑:起初,我还没有发现综合模式下的precondition,这可能是因为新的托管运行在经典模式您的应用程序
At first I haven't noticed the precondition for integrated mode, could it be that the new hosting runs your app in classic mode?
这篇关于如何设置在web.config中与IIS7的处理程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!