转换MVC 2 ASPX到MVC 4的Razor视图引擎 [英] Convert MVC 2 ASPX into MVC 4 Razor view engine

查看:287
本文介绍了转换MVC 2 ASPX到MVC 4的Razor视图引擎的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在对MVC 2与Visual Studio 2010和视图引擎为 ASPX 类型的项目。

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

所以我决定与Visual Studio 2012年MVC 4和视图引擎作为移动剃须刀

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

所以,我可以达到上述task.If又如何?

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.

推荐答案

在Visual Studio 2012中新的MVC4项目,并从旧的解决方案,一次添加源文件到您的新的解决方案之一。从MVC3移动到MVC4是一个新的解决方案更容易,我必须想象,从2去 - > 4会更加复杂,尝试就地升级

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.

转换,从ASPX剃刀也许应该手动完成。虽然有转换器在那里(如这个或code像的这太问题),我个人我的应用程序不会相信纯粹的自动化

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.

另外,我可能会转换一次。 >剃刀或MVC2 - - 换句话说,从ASPX转换> MVC4第一,确保一切工作与你的转换。然后转换成另一种,这样,如果您遇到任何问题,你不必揣摩无论是版本升级或导致你的问题的语法升级。

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.

这篇关于转换MVC 2 ASPX到MVC 4的Razor视图引擎的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆