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!