I’m hoping there is a simple solution to this. I’m using MVC 3. I have two projects in my solution, a class library named MyApp.Domain, and an MVC 3 Web application named MyApp.WebUI.
In MyApp.Domain, I have this file:
namespace MyApp.Domain.Test
{
public class MyHandler : IHttpHandler
{
public bool IsReusable
{
get { return false; }
}
public void ProcessRequest(HttpContext context)
{
context.Response.Write("test");
}
}
}
In MyApp.WebUI, in the web.config in the root of the project, I have this:
<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="*.testhandler" type="MyApp.Domain.Test.MyHandler"/>
</httpHandlers>
</system.web>
</configuration>
But if I navigate to http://localhost:52233/test.testhandler, I get a 404 error. I imagine there’s some sort of namespace issue, but I don’t know how to fix it.
Anyone come across this issue?
Try to ignore your URL pattern in the routing. Add this before the default route in the global.asax: