External razor views can't see external models

后端 未结 2 1486
醉话见心
醉话见心 2021-01-29 05:27

I have a problem with external razor views. In my project I have main mvc web assembly and dynamically loaded external class library assemblies(from DB) with their own Controlle

2条回答
  •  -上瘾入骨i
    2021-01-29 05:48

    I was able to precompile views with RazorGenerator Visual Studio extension (not RazorGenerator.Mvc one) in my assemblies.

    It basically converts .cshtml razor views into .cs files with WebViewPage classes before assemblies compile. And in my web project I had to implement my own VirtualPathProviderViewEngine similar to this one

提交回复
热议问题