O.O O.O - 29 days ago 13
ASP.NET (C#) Question

Type 'ASP._Page_index_cshtml' does not inherit from 'System.Web.WebPages.WebPage'

I am getting:


Type 'ASP._Page_index_cshtml' does not inherit from 'System.Web.WebPages.WebPage'.


when I browse to my index.cshtml file. It is very simple:

@using System.Web.Optimization
@inherits System.Web.Mvc.WebViewPage
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width">
<title>Hello World</title>
@Styles.Render("~/Content/css", "~/Content/themes/base/css")
@Scripts.Render("~/bundles/modernizr")
</head>
<body>
@Scripts.Render(
"~/bundles/jquery",
"~/bundles/jqueryui"
)
</body>
</html>


my index.cshtml file is outside of the Views folder, if that matters at all.

O.O O.O
Answer

I just had to remove: @inherits System.Web.Mvc.WebViewPage

Looks like I had a copy paste error when reorganizing my project.

Comments