使用Visual Studio 2010 precompile一个ASP.NET4 MVC3网站 [英] Precompile a asp.net4 mvc3 website using visual studio 2010

查看:301
本文介绍了使用Visual Studio 2010 precompile一个ASP.NET4 MVC3网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是pre-编译ASP.NET4 MVC3网站,使用Visual Studio 2010的所有视图文件的最好方法?

What is the best way to pre-compile a asp.net4 mvc3 website with all its view files using visual studio 2010?

我有点困惑,因为MS提供的声音非常相似的多种解决方案。

I'm a little confused because MS provides multiple solutions that sound very similar.

Web部署项目

<一个href=\"http://blogs.msdn.com/b/webdevtools/archive/2010/05/26/visual-studio-2010-web-deployment-projects-rtw-available-now.aspx\">http://blogs.msdn.com/b/webdevtools/archive/2010/05/26/visual-studio-2010-web-deployment-projects-rtw-available-now.aspx

Web部署工具

<一个href=\"http://www.microsoft.com/download/en/details.aspx?id=25230\">http://www.microsoft.com/download/en/details.aspx?id=25230

或者我能不能做到这一切从默认VS2010 SP1没有额外的插件?

or can I just do all this from the default VS2010 SP1 without additional addons?

有人能澄清?

推荐答案

当你建立或发布项目,该网站已经编译。只有视图动态编译。如果你希望你的意见,又还编,您可以编辑您的Web项目文件。改变这一行:

When you build or publish your project, the website is already compiled. Only the views are dynamically compiled. If you want your views to be compiled also, you can edit your web project file. Change this line:

<MvcBuildViews>false</MvcBuildViews>

<MvcBuildViews>true</MvcBuildViews>

要能够编辑你必须先卸载项目在Visual Studio中的项目文件(单击鼠标右键,卸载项目),然后再次右键单击该项目并选择编辑项目。
当你所做的更改,您的意见将被自动建立也。
这是不是你想要在开发过程中做,建造时间的东西显著增加。

To be able to edit the project file within visual studio you have to unload the project first (right-click, Unload Project) and then right click the project again and choose Edit Project. When you made the change, your views will be automatically be build also. This is not something you want to do during development, build time significantly increases.

这篇关于使用Visual Studio 2010 precompile一个ASP.NET4 MVC3网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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