tags:

views:

45

answers:

2

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

A: 

Remove the routes set in the Global.ascx

Dustin Laine
I get this error..."The incoming request does not match any route"
Luke101
Remove the routing entries from the web.config.
Dustin Laine
+2  A: 

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?

Darin Dimitrov
Yeah, disabling routing kinda defeats the whole MVC paradigm
PieterG
@PieterG, you are absolutely right, routing is a core component in the MVC paradigm.
Darin Dimitrov
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.
mnemosyn