I just create a new MVC 4 Web API project, and create a new .cshtml file, containing very simple HTML:
&
I had the same message in an MVC project and it turned out that I was missing a critical piece of the MVC framework, the Global.asax and Global.asax.cs entries. I selected the project in Solution Explorer and did an Add, New Item, Global Application Class. I then edited it and replaced the Application_Start with the necessary config items:
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
This solved it for me.