Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Precompile a asp.net4 mvc3 website using 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?

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

Web Deployment Projects

http://blogs.msdn.com/b/webdevtools/archive/2010/05/26/visual-studio-2010-web-deployment-projects-rtw-available-now.aspx

Web Deployment Tool

http://www.microsoft.com/download/en/details.aspx?id=25230

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

Can someone clarify?

like image 850
James Avatar asked Aug 23 '11 19:08

James


1 Answers

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>

to:

<MvcBuildViews>true</MvcBuildViews>

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.

like image 113
Robin van der Knaap Avatar answered Oct 03 '22 12:10

Robin van der Knaap