编译ASP.NET MVC意见 [英] Compile Views in ASP.NET MVC

查看:341
本文介绍了编译ASP.NET MVC意见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要一个MSBuild任务编制的意见,这样我就可以看看是否有编译时错误的好...编译时间。任何想法?

I want an msbuild task to compile the views so I can see if there are compile time errors at well... compile time. Any ideas?

推荐答案

我坦率地说会建议RazorGenerator的NuGet包。当你保存并在收到编译时错误对你的看法顶你的看法已经产生了了.Designer.cs文件的方式,他们也$ pcompiled到组件(=更快的热身)p $和ReSharper的提供了一些额外的帮助,好。

I frankly would recommend the RazorGenerator nuget package. That way your views have a .designer.cs file generated when you save them and on top of getting compile time errors for you views, they are also precompiled into the assembly (= faster warmup) and Resharper provides some additional help as well.

要使用包括你RazorGenerator的NuGet包的ASP.NET MVC项目,并在工具项目下安装了剃刀发生器扩展 - >扩展和更新

To use this include the RazorGenerator nuget package in you ASP.NET MVC project and install the "Razor Generator" extension under item under Tools -> Extensions and Updates

我们使用这个和每个这种方法编译开销要少得多。在此之上,我可能会建议由展鹏.NET恶魔从而进一步降低大幅编译时间的影响。

We use this and the overhead per compile with this approach is much less. On top of this I would probably recommend .NET Demon by RedGate which further reduces compile time impact substantially.

希望这有助于。

这篇关于编译ASP.NET MVC意见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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