When compiling in MVC 4, let view also eject exception

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.