I use VirtualPathProvider to provide thematic views.
In the action method, I want to return the view along the way
return View("~/Themes/SomeTheme.dll/Views/Content/Item.cshtml");
In Visual Studio Item.cshtml there is an "Embedded Resource" assembly action.
VirtualPathProvider finds this .cshtml file, but I get an error
The view at '~/Themes/SomeTheme.dll/Views/Content/Item.cshtml' must derive from WebViewPage, or WebViewPage<TModel>.
I assume I need to compile this view, and I followed these instructions .
Now VirtualPathProvider cannot find Item.cshtml as it is no longer an embedded resource.
How to solve this problem? I can not add a link to this SomeTheme.dll because the activated theme loads dynamically when the application starts.
I did this before with aspx files, and they did not need to be compiled. They worked out of the box as embedded resources.
source
share