Hi,
I have a custom view engine in ASP.NET MVC and since upgrading to RC1 my custom view engine that implements Areas as in this post by Phil Haack does not enter the override method FindView, thus breaking any controllers that sit within an area as the application is unable to find them. As I'm aware that a good number of people are using areas in their MVC applications, is anyone aware of a solution to this problem or why it happens?
Below is my findview method for reference.
public override ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName)
{
ViewEngineResult areaResult = null;
if (controllerContext.RouteData.Values.ContainsKey("area"))
{
string areaViewName = FormatViewName(controllerContext, viewName);
areaResult = base.FindView(controllerContext, areaViewName, masterName);
if (areaResult != null && areaResult.View != null)
{
return areaResult;
}
string sharedAreaViewName = FormatSharedViewName(controllerContext, viewName);
areaResult = base.FindView(controllerContext, sharedAreaViewName, masterName);
if (areaResult != null && areaResult.View != null)
{
return areaResult;
}
}
return base.FindView(controllerContext, viewName, masterName);
}