Like this question, I use my own VirtualPathProvider to retrieve the views embedded in the DLL. If I do not put @inherits System.Web.Mvc.WebViewPage
in my opinion, I get this error:
The view at '~/Views/Home/Index.cshtml' must derive from ViewPage, ViewPage<TModel>, ViewUserControl, or ViewUserControl<TModel>.
I am using a custom BaseViewPage that inherits from WebViewPage. Before I started using this custom VirtualPathProvider, the new base page in web.config worked. Now, if I try to inherit my own class on the page using @inherits My.BaseViewPage
, I get the same error as above.
For completeness, I add that the page starts compiling if I inherit WebViewPage, but it throws an error because there is code expecting the view to have properties from BaseViewPage.
source share