7

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?

1
  • Look at the deployment section of your project properties for your selected configuration (example debug).... Commented Aug 23, 2011 at 20:07

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

2 Comments

I had replied the same thing, but a few seconds too late, so I removed it. Here's a maybe useful blog entry from Lord Haack: haacked.com/archive/2011/05/09/…
If you get an strange aspERR errors when trying to build. Turn off MvcBuildViews temporarily to see what the build problem is.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.