Similar to this question I am using a custom VirtualPathProvider to retrieve views that are embedded in dlls. If I don't put @inherits System.Web.Mvc.WebViewPage
on my view I get this error:
The view at '~/Views/Home/Index.cshtml' must derive from ViewPage, ViewPage<TModel>, ViewUserControl, or ViewUserControl<TModel>.
I'm using a custom BaseViewPage that inherits from WebViewPage. Before I started using this custom VirtualPathProvider, setting the new base page in the web.config worked. Now, if I try to inherit my custom class on the page with @inherits My.BaseViewPage
I get the same error as above.
For completeness' sake I'll add that the page does start to compile if I inherit from WebViewPage, but it throws an error because there is code expecting the view to have properties from BaseViewPage.