Is it possible to upgrade an MVC 1 project to MVC 3 and use the Razor view engine along side the original one?
The original view engine being the .aspx files with the <% %> riddled all over. I kind of want to move away from that, but I want the old code files to still work fine as I migrat开发者_StackOverflowe.
Are there any good methods for this and/or snags I should be aware of?
It is not possible to upgrade from v1 to v3 directly using a tool. You will have to first upgrade using this tool and then use this version to get it to MVC3.
You can also use both view engines together without a problem as seen here.
It is possible to use a mixture of both engines, and you can include ascx partial views into Razor views, which is helpful during the transition.
aspx and cshtml (Razor) views cannot share a master page, so ultimately you have to have two masters (one for the old, one for the new). However, you can generally refactor most of your master page into a handful of ascx files, which you can then use with both the 'old' and the 'new' master pages.
精彩评论