Precompile a asp.net4 mvc3 website using visual studio 2010
Asked Answered
L

1

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?

Longley answered 23/8, 2011 at 19:59 Comment(1)
Look at the deployment section of your project properties for your selected configuration (example debug)....Mere
G
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.

Gotthelf answered 23/8, 2011 at 20:13 Comment(2)
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/…Uredium
If you get an strange aspERR errors when trying to build. Turn off MvcBuildViews temporarily to see what the build problem is.Oshaughnessy

© 2022 - 2024 — McMap. All rights reserved.