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.