Does anyone know if there is a reason why _ViewStart.cshtml wouldn't get picked up with a Custom ViewEngine in MVC 3?
My Views now live at
~\UI\Views\
~\UI\Views\Shared\
with ViewStart being at ~\UI\Views_ViewStart.cshtml.
I've cleared out the existing RazorViewEngine and replaced it with mine in the global.asax and all the views resolve properly except none of the layout pages get applied unless I specify it individually in each view.
My engine path format code is:
this.ViewLocationFormats = new[]
{
"~/UI/Views/{1}/{0}.cshtml",
"~/UI/Views/Shared/{0}.cshtml"
};
this.PartialViewLocationFormats = new[]
{
"~/UI/Views/Shared/{0}.cshtml",
"~/UI/Views/Shared/Partial/{0}.cshtml",
"~/UI/Views/{1}/Partial/{0}.cshtml"
};
this.AreaMasterLocationFormats = new[]
{
"~/UI/Views/Admin/Shared/{0}.cshtml"
};
this.AreaPartialViewLocationFormats = new[]
{
"~/UI/Views/Admin/Shared/{0}.cshtml",
"~/UI/Views/Admin/Shared/Partial/{0}.cshtml"
};
this.AreaViewLocationFormats = new[] { "~/UI/Views/Admin/{1}/{0}.cshtml" };
this.MasterLocationFormats = new[]
{
"~/UI/Views/{1}/{0}.cshtml",
"~/UI/Views/Shared/{0}.cshtml"
};
Thanks in advance, Scott