I've recently taken an existing ASP.NET 3.5 web forms application that was upgraded to .NET 4 last year (and has been running fine) and configured it to also run ASP.NET MVC3 following Scott Hanselman's blog post: Integrating ASP.NET MVC 3 into existing upgraded ASP.NET 4 Web Forms applications. It works well and I've successfully begun to introduce views based on Razor and the existing aspx
pages continue to work.
The one thing that has stopped working, however, is a custom HttpHandler (our load balancer hits a specific address to ensure the application is available - the handler is for that address). The web.config has always declared the handler in the system.web
section like this:
<httpHandlers>
<add verb="*" path="system/heartbeat.aspx"
type="My.Monitor.HttpHandlers.LoadBalancerHandler, My.Monitor"/>
</httpHandlers>
Now we're testing post-MVC3 and I'm getting an exception that reads:
The controller for path '/system/heartbeat.aspx' was not found or does not implement IController.
I have defined a RegisterRoutes
method in my Global.asax
and that method is called from the Application_Start
. Within RegisterRoutes
I've got the IgnoreRoute
declarations from Hanselman's blog:
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{resource}.aspx/{*pathInfo}");
which I thought was to prevent the Routing system from taking anything with an extension of .aspx.
I can reproduce the issue in VS2010 as I debug, and the deployment environment is running IIS 6.
What can I do to prevent the Routing system from trying to handle that address so the custom handler can do it's thing? Any help is appreciated.
Try like this:
routes.IgnoreRoute("system/heartbeat.aspx");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With