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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With