Previous Entry Share
Converting from MVC2 to MVC3
There's already a lot of info addressing the conversion from MVC2 to MVC3.

This link has a pretty good run down of your options, succinctly presented:

I personally had a problem that I wasn't finding any relevant hits for on Google - here're the details:

Compiler Error Message: CS0103: The name 'model' does not exist in the current context
The first line in my .cshtml file was:
@model System.Collections.Generic.List<ltmi.web.Models.AdminMemberCompleteFieldsModel>

The line was generated by VS.  To this point I thought I had completed the conversion, but this was my first actual attempt at using a Razor view in this application, and it turns out I still had one piece missing: I grabbed the web.config file from the Views folder of another "pure"  MVC3 app and just copied it over the web.config in the Views folder of my MVC3 app converted from MV2.  That fixed it.

I got the hint from here: (see answer by "Wiaan")

Now I get to use the clean Razor syntax and gradually replace web form views with Razor views.

Happy Coding!


Log in