MVC 5.0-type "ASP. _ Page _ ViewStart_cshtml" does not inherit from "System. Web. WebPages. StartPage" & gt;, mvcviewstart. cshtml

Source: Internet
Author: User

MVC 5.0-<type "ASP. _ Page _ ViewStart_cshtml" is not inherited from "System. Web. WebPages. StartPage">, mvcviewstart. cshtml
In actual projects, we usually add an MVC Empty project first, and then add anything to it. However, in the Empty project, only one route is registered and there is no _ ViewStart. the cshtml file needs to be added by yourself. As a result, the blogger is eager to add a _ ViewStart to it based on previous experience. cshtml view file, and then add _ Layout. cshtml file and Shared folder, and _ ViewStart. the Layout of cshtml is specified to the _ Layout file under the Shared folder. After compilation starts, the following error occurs!
The type "ASP. _ Page _ ViewStart_cshtml" is not inherited from "System. Web. WebPages. StartPage !! What is this mistake? I have never met before, and I will check it carefully. Baidu and google have no results! Instead, you can create another project to compare the differences. The folders on each layer are clicked to compare the differences. After checking that the folders on each layer are not the same for several times. When I want to give up, I find that there is a Web under the Shared folder. config, but I did not add the Shared folder below, suddenly think of the MVC mechanism, the heart of 10 thousand horses fly, just blame myself too careless. Finally, we moved Web. ConfigCopy from the new project to solve the problem!

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.