在 asp .net mvc 5 中预编译剃刀视图 [英] Pre-compile razor views in asp .net mvc 5

查看:22
本文介绍了在 asp .net mvc 5 中预编译剃刀视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 ASP .Net MVC5 网站,我有性能问题,我想在 IIS 中部署我的网站时预编译 razor 视图并排除它们,我按照 这篇文章 但我得到了一个错误:RazorGenerator.targets 没有找到,实际上我在包文件夹中检查了我没有找到这个文件.你知道为什么在包文件夹中找不到这个 dll 吗?RazorGenerator.MvcRazorGenerator.MsBuild 已正确安装.提前致谢

I have an ASP .Net MVC5 website, I have performance issues, I want to pre-compile the razor views and exclude them when deploying my website in IIS, I followed the steps indicated in this article but I got an error : RazorGenerator.targets was not found, in fact I checked in the package folder I din't find this file. Do you have any idea why this dll not found in the package folder ? The RazorGenerator.Mvc and RazorGenerator.MsBuild are installed correctly. Thanks in advance

推荐答案

为此,您不需要 RazorGenerator.发布时,只需在设置"选项卡上的文件发布选项"下将选项设置为发布期间预编译".单击配置",然后勾选将所有输出合并到单个程序集".给它一个唯一的名称,通常类似于 [ProjectName].Precompiled.

You don't need RazorGenerator for this. When publishing just set the option to "Precompile during publishing", under "File Publish Options" on the "Settings" tab. Click "Configure" and then tick "Merge all outputs to a single assembly". Give it a unique name, generally something like [ProjectName].Precompiled.

这篇关于在 asp .net mvc 5 中预编译剃刀视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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