Be alert! A pre-compiled version of higher VS causes Razor in Mono to fail to find the view.

Source: Internet
Author: User

Some time ago, a friend found me in the Q group and said that it follows "Linux. NET learning note, put an ASP. after the project of net mvc 4.0 is deployed to Mono, Razor cannot find the view. It took some weeks to solve the problem. In the recent period, other friends in the Group encountered the same problem. Over time, more and more friends may use the higher version of, so I reproduced the current situation and recorded the solution.

As usual, we created an MVC4 project.

Add a view, the default one (/Home/Index), and then release it to Linux. NET.

Then this unpleasant page is displayed. Our Razor cannot find the view.

In fact, we have this view, and there are no common case and permission problems.

For the sake of experience. NET Nactive, installed VS2013 and added the Update package, So I focused on this Update, it is not ruled out that updates are caused by changes in system configurations such as Config or DLL.. NET.

After some troubleshooting, I suddenly found that VS had something that was easy to ignore at the place where it was released (collapsed at ordinary times ).

As you can see in the middle, the option contains the option "pre-compile during release. Remove this check box and release it again. Refresh the page again:

The Razor engine returns to normal again, and the view is located again.

Currently, the "pre-compile upon release" feature is available in VS2013 and VS2012 Update2 and later versions. You should pay more attention to this feature.

 

 

Related Article

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.