Last post Jun 23, 2010 09:18 PM by Mobius5150
Jun 21, 2010 03:05 AM|Mobius5150|LINK
I built a custom HTTPhandler for handling image requests, and it works perfectly from the development environment, but does not when I run it from IIS on the server. I have registered a managed handler with IIS for the specific files and directories, but
whenever an image is requested, and the request is handled by the handler I get a "500 Internal server error" with no hint as to what the problem is.
Does anyone know of a way that I can see the error message for this? Tracing and debugging I believe are turned on.
And for the record im using IIS 7 on windows server 2008, and the site is working in Integrated mode with ASP.NET 4
I also just went and changed the handler so that the only line in it returns a 404 error, compiled, and I still get a 500 internal server error.
Does anyone have any ideas what could be causing this?
Jun 21, 2010 05:25 AM|SilverSwan|LINK
Do you see any information about it in your eventlog?
Could be a security or configuration problem.
Jun 21, 2010 10:24 AM|Mobius5150|LINK
Hey, thanks for the reply.
I check in the even log, and found this for one of the files in question:
Exception type: HttpException
Exception message: Could not load type 'Handlers.ImageRequestHandler'.
at System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
at System.Web.Configuration.HandlerFactoryCache.GetTypeWithAssert(String type)
at System.Web.Configuration.HandlerFactoryCache.GetHandlerType(String type)
at System.Web.Configuration.HandlerFactoryCache..ctor(String type)
at System.Web.HttpApplication.GetFactory(String type)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Two things about this: The handlers class is "ImageRequestHandler". It used to be in the namespace "Handlers" but isnt anymore.
I searched the solution for any reference to Handlers.ImageRequestHandler and found nothing -- Incl. the web.config files.
Jun 23, 2010 09:18 PM|Mobius5150|LINK
Okay, found the issue.
So that it would work in my development environment, I still had the <httpHandler></httpHandler> tags in the web.config, along with the IIS 7 <handlers></handlers> tag. When you have both of these it apparently causes issues.