11

What differences are there between using the .csproj setting MvcBuildViews and using Razor Generator to achieve the same thing?

My own presumption is that MvcBuildViews does not make intelli-sense of views available to unit tests, but what other differences might there be?

Community
  • 1
  • 1
Brent Arias
  • 29,277
  • 40
  • 133
  • 234

1 Answers1

21

MVCBuildViews doesn't actually pre-compile your views for deployment. It's compiling the views after building your solution to echo any errors that may be in any of your MVC views before you deploy. This way you can catch compile errors for Views before pushing them to your server to avoid the error page or yellow screen of death at runtime.

The RazorGenerator can be used to pre-compile your views to avoid any compiling warmup times on the first hit of any View on your server. When using the RazorGenerator tool you can deploy the assembly for the application instead of the Views Folder, since all the views will be pre-compiled and contained inside that assembly.

SliverNinja - MSFT
  • 31,051
  • 11
  • 110
  • 173
Gabe
  • 49,577
  • 28
  • 142
  • 181