[Perfect solution] 2017 open the MVC 4 Project, And the cshtml page prompts 'the current context does not have a name model ',
Time:
Background: lead to add new features to the previous MVC 4 Project, pull them from GIT, and use VS2017 to open them, all Razor-related code on the cshtml interface is prompted with 'no name XXX exists in the current context 'and no smart prompt is displayed, but compilation and running are not affected.
Solution: the web. config version in the Views folder is incorrect in most cases after a large circle of Baidu. In the afternoon, I decided to ask daxie @ Lao Nong. After instruction, I started the vs2017 repair and found that ASP was selected when we installed vs2017. NET and Web.. NET and Web development. NET MVC4 is not selected, as shown in figure
Therefore, an error is reported when you open the cshtml of the MVC 4 project because MVC4 is not installed.
Record the information to help the students quickly solve similar problems.
Thank you @ Lao Nong!
It is helpful to pay more attention to the open-source web framework ZKWEB of Lao Nong. Remember star.