Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Run an ASP.NET MVC4 application on Mono 3.2.8. When the controller action returns string,
for example:
public string Index()
{
return "MVC4 Page...";
}

the browser renders OK,
but when the controller action returns View(), for example:

public ActionResult Index()
{
return View();
}

The error messages are as follows:

System.InvalidOperationException
The view 'Index'or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Home/Index.aspx
~/Views/Home/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx
~/Views/Home/Index.cshtml
~/Views/Home/Index.vbhtml
~/Views/Shared/Index.cshtml
~/Views/Shared/Index.vbhtml


However, ~/Views/Home/Index.cshtml does exist.


How do I solve the problem?
Posted
Updated 14-Apr-14 22:50pm
v2

Check You RouteConfig.cs File and set your Controller and Action values. Hope it helps. :)
 
Share this answer
 
This means no view found for Index action method. So you need to add a view in with 'Index' name.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900