如何编译运行之前CSHTML [英] How to compile cshtml before runtime

查看:1222
本文介绍了如何编译运行之前CSHTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我相信我读的地方,有一个在项目文件,让你建立你的Visual Studio项目时编译 .cshtml 文件中的一个设置。

I believe I read somewhere there is a setting in one of the project files that will allow you to compile the .cshtml files when building your Visual Studio project.

刚开始接触 MVC /剃刀/查询移动,和我越来越恼火了错误加载页面时,我有一个code座的错误一个 .cshtml 文件中

Just getting started with MVC/Razor/Query Mobile, and am getting annoyed with the "Error loading page" when I have an error in a code block inside a .cshtml file

推荐答案

设置< MvcBuildViews>真< / MvcBuildViews> <的PropertyGroup方式> 您的.csproj文件的元素

Set <MvcBuildViews>true</MvcBuildViews> in the <PropertyGroup> element of your .csproj file.

这篇关于如何编译运行之前CSHTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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