Troubleshooting the addition of MVC to an ASP.NET WebForms application

I have an ASP.NET WebForms application that I'm trying to switch to MVC for new development. I'm generally following this tutorial plus Google and Stack Overflow. The setup has been "easy", but for some reason I can't seem to get the first MVC controller/view to appear.

My first thought was that I had a problem with the routing, so I installed this nifty routing debugger. I got this to work, and toyed with my routing settings a bit. Eventually I went nuclear and set the following as my entire routing scheme:

routes.MapRoute("Default",
  "{*catchall}",
  new { controller = "Home", action = "Index", id = "" }
);

RoutingDebug suggests that routing is indeed working: when I navigate to "/appname/foo" (where "/appname" is my project's virtual path; I'm using the ASP.NET development server at the moment), I get a "True" result for my (first) catchall route, and Home/Index for my controller/action.

However, when I turn off RoutingDebug, I don't get the Home/Index view; instead I get a 404. Additionally, any time I navigate to a legacy .aspx page (either with or without RoutingDebug active) I get the content from the legacy page (I expect to get the view since the route captures every URL).

Thus, it looks to me like, while routing is working, the actual "MVC parts" are not being activated properly. I believe I followed the tutorial correctly so I'm at a loss to explain what's going wrong. How can I determine what the problem is? What things should I be checking?

Answers


I know this doesn't directly answer your question but have you tried to turn the switch around? Create a brand new MVC Application and import all your existing files. We did that with our migration and we found it much simpler than trying to thread MVC into an existing WebForms app.


Need Your Help

What happened to Dojo in 2008?

jquery ajax dojo history

Many of you have seen this graph of Google Trends of popular AJAX frameworks (Dojo, jQuery, YUI).

CE Join on columns with different names

sql sap hana

I have seen several examples to write CE functions. BUt, I have not come across any example where a join is performed on columns with different name.