Just would like to know how do I disable URL Rewriting in asp.net MVC. I don't need url rewriting in my application and would like to turn it off. Reason: I am aware that url rewriting uses reflection and would like to save a few cpu cycles by avoiding it. Thanks
2 Answers
If you are concerned about performance then don't be. The routing engine, despite the fact that uses reflection is very optimized. Also if you turn routing off how do you expect your controller actions to be invoked?
4 Comments
Pieter Germishuys
Yeah, disabling routing kinda defeats the whole MVC paradigm
Darin Dimitrov
@PieterG, you are absolutely right, routing is a core component in the MVC paradigm.
mnemosyn
I couldn't agree more. There is no point in disabling routing in MVC. Also, 'a few cpu cycles' is nothing in a web application. The mere TCP overhead is probably a millionfold.
SturmUndDrang
We would like to do the same - we are using AngularJS so the MVC URL routing is redundant. We are still using other parts of the MVC framework though. Removing the routing from the Global.asax.cs and web.config doesn't work as IIS Express is not able to serve up pages (404 and 403 errors)
Remove the routes set in the Global.ascx
2 Comments
Luke101
I get this error..."The incoming request does not match any route"
Dustin Laine
Remove the routing entries from the web.config.