Objective
MVC at compile time, will not prompt the view in the error, we publish the project will be a hint of the exception, the project will be a big headache, because each release requires at least 5 minutes, and finally received only one exception information, if the page abnormally too much, For example, the recent reorganization of the code to modify a lot of the underlying code, so that the publication of the way to find abnormal efficiency is very low
Workaround
Reference URL: http://www.dotnetcurry.com/showarticle.aspx?ID=698
http://haacked.com/archive/2011/05/09/compiling-mvc-views-in-a-build-environment.aspx/
1. First right click on the project file and click on "Unload Project" option
2. Then right-click the project file again and tap the [edit] option
3. In the open page, locate <propertygroup condition= "' $ (Configuration) |$ (Platform) ' = = ' debug| AnyCPU ' > (each vs version node may be different)
Add the <MvcBuildViews>true</MvcBuildViews> property to the secondary node, and if you compile with debug, add it under the Debug node
4. Drag the page to the bottom and add the following to the last section </Project> front
<Name= "Mvcbuildviews" aftertargets= "Afterbuild" Condition= "' $ (mvcbuildviews) ' = = ' true '><virtualpath = "Temp" physicalpath= "$ (webprojectoutputdir)"/></ Target>
5. Finally select the project file, right click Reload Project, click Save, you can
Original address: http://www.cnblogs.com/linfei721/p/3990457.html
When compiling in MVC 4, let view also eject exception