I have created a Generic Handler using Studio 2012. I'm able to call it on my local machine. When I move it up to my IIS 8.5 server I'm getting a message saying "An Internal Server Error has occurred" The event viewer lists the error code as 1310.
To deploy I'm going to my project folder and copying TestHandler.ashx and TestHandler.ashx.cs and placing them in the root folder. This folder contains all of the files that run the DotNetNuke 8.0 CMS system. It is not clear to me if DotNetNuke is interfering, or there are additional files to copy, but I've read there is no need to register an ashx with web.config.
I have not added custom code to the TestHandler yet.
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.Write("Hello World");
}
Because you have 2 files for the Handler (.ashx and ashx.cs) you probably created it in a Project. Did you compile it and copied the .dll file into the /bin
directory of the DotNetNuke installation? If not what is the exact error message in the Event Viewer?
But this snippet does not require 2 files, just save it as an .ashx file and it will work.
<%@ WebHandler Language="C#" Class="Handler1" %>
using System;
using System.Web;
public class Handler1 : IHttpHandler {
public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "text/plain";
context.Response.Write("Hello World");
}
public bool IsReusable {
get {
return false;
}
}
}