I’ve just discovered this property in MVC projects, but I’m having a hard time determining if it has any real effect. The following makes me believe this property has almost no real effect out of the box:
- It does an in-place compilation of the site (AFAICT), and leaves the site “updateable” so that the markup files are not affected. This is important for in-place compilation so the sources aren’t wiped out.
- Because it’s in a WAP project, all the code files will be compiled into the project’s output assembly anyways (unless they’re in App_Code, but that’s just odd).
So the sources in the project were already compiled, and the markup files aren’t affected. What is the actual impact of using MvcBuildViews?
When
<MvcBuildViews>is set to true, building the web project results in errors if the views contain any server-side code issues. Note that this includes C# errors (compile-time / type-safety / etc.), but not JavaScript errors, as those are intrinsically non-compiled.This feature works for Razor and WebForms views, but it seems to have no effect when the Spark view engine is being used.