MVC3 app ignoring Razor .cshtml extension
I am trying to run an MVC3 with Razor web project for the first time. The project was generated by S#arp Architecture, so there could be some wiring missing.
The de facto web.config with the Razor entries has been created under the Views folder. Here is the error for ~/
[InvalidOperationException: The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Index.aspx
~/Index.ascx
~/Views/Home/Index.aspx
~/Views/Home/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx]
开发者_开发技巧
Any idea what's missing? Thanks.
Adding
ViewEngines.Engines.Add(new RazorViewEngine());
To
Application_Start()
in Global.asax.cs
Did the trick
精彩评论