ASP.NET MVC3,使剃须刀 [英] ASP.NET MVC3, Enable Razor
本文介绍了ASP.NET MVC3,使剃须刀的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我升级的MVC2项目MVC3现在想开始使用的Razor视图引擎,但是当我做添加 - >查看它不给我选择的视图引擎的选项。
我在我的视图文件夹更新的Web.config,并用新的MVC 3的项目相比,但没有什么工作。
任何想法?
解决方案
我通过在.csproj的文件更改ProjectTypeGuids元以下的固定这样的:
<$p$p><$c$c><ProjectTypeGuids>{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>我现在可以选择剃刀或ASPX作为我的视图引擎。
I've upgraded an MVC2 project to MVC3 and now want to start using the Razor view engine but when I do Add->View it doesn't give me the option to choose the view engine.
I have updated the Web.config in my views folder and have compared with a new MVC 3 project but nothing is working.
Any ideas?
解决方案
I fixed this by changing the ProjectTypeGuids element in the .csproj file to the following:
<ProjectTypeGuids>{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
I can now choose either Razor or ASPX as my view engine.
这篇关于ASP.NET MVC3,使剃须刀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文