title: Using custom VirtualPathProvider to load embedded views that inherit a custom WebViewPage
body: <p>Similar to <a href="https://stackoverflow.com/questions/7746253/using-custom-virtualpathprovider-to-load-embedded-resource-partial-views">this question</a> I am using a custom VirtualPathProvider to retrieve views that are embedded in dlls.  If I don't put <code>@inherits System.Web.Mvc.WebViewPage</code> on my view I get this error:</p>
  
  <pre><code>The view at '~/Views/Home/Index.cshtml' must derive from ViewPage, ViewPage&lt;TModel&gt;, ViewUserControl, or ViewUserControl&lt;TModel&gt;.
  </code></pre>
  
  <p>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 <code>@inherits My.BaseViewPage</code> I get the same error as above.</p>
  
  <p>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.</p>