Convert MVC 2 ASPX into MVC 4 Razor view engine

蹲街弑〆低调 提交于 2020-01-02 02:22:25

问题


I am currently working on MVC 2 with visual studio 2010 and view engine as ASPX kind of project.

So I have decided to move with Visual studio 2012 with MVC 4 and view engine as Razor.

So could I achieve above task.If so How ?

I would like to hear your experience for similar kind of situation.

Note : My project is a large one.


回答1:


Create a new MVC4 project in Visual Studio 2012 and add source files from your old solution to your new solution one at a time. Moving from MVC3 to MVC4 is easier with a new solution, I have to imagine that going from 2 -> 4 would be even more complex to try to upgrade in-place.

Conversion from ASPX to Razor should probably be done manually. Although there are converters out there (like this one or code like the accepted answer in this SO question), I personally wouldn't trust my application to pure automation.

Also, I would probably convert one at a time. In other words, convert from ASPX -> Razor or MVC2 -> MVC4 first and make sure everything works with your conversion. Then convert the other one so that if you run into any problems, you don't have to try to figure out whether it's the version upgrade or the syntax upgrade that caused your problem.



来源:https://stackoverflow.com/questions/16375029/convert-mvc-2-aspx-into-mvc-4-razor-view-engine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!