Thursday 6 October 2011

Notes on upgrading MVC 2 to MVC 3

Finally found the time to upgrade a customers MVC 2 project to MVC 3 (something has always been more important).
There are a great tool for upgrading an MVC 2 project. More info found here: http://blogs.msdn.com/b/marcinon/archive/2011/01/13/mvc-3-project-upgrade-tool.aspx.
So far so good. But ReSharper (5.1.3000.12) started to give me a lot of errors in my views. First there was “Cannot resolve symbol Html/Url” etc. That problem was solved by deleting the cache files (xxx.Resharper.user). But then it started given my errors on
   1: <%=Html.LabelFor(m => m.xxx) %>
saying System.Core should be referenced. This was solved by adding

   1: <Reference Include="System.Core">
   2:   <Private>True</Private>
   3: </Reference>
in the csproj-file.
Now everything seems alright…

No comments:

Post a Comment