Blog on software engineering
Custom IHttpHandler 404 not found in .NET Framework 4.7.2

Custom IHttpHandler 404 not found in .NET Framework 4.7.2


When you add a custom IHttpHandler to your ASP .NET Framework 4.7.2 project in a root folder like /Handlers/MyHandler.ashx and you access the url /Handlers/MyHandler.ashx, this handler will be executed,

But if you want this handler to be executed on another path, you will have to register the custom IHttpHandler.


In my case on IIS 10 with application pool in integrated mode (Managed Pipeline Mode = Integrated):

    <add name="DownloadFile" verb="*" path="Helpers/DownloadFile.ashx" type="My.Custom.NameSpace.MyHandler, My.Assembly " resourceType="Unspecified" />


But if you are also using MVC routing, you will have to ignore this route in the MVC routing:


public static void RegisterRoutes(RouteCollection routes)






Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.