开发者

Embedded views and localization

开发者 https://www.devze.com 2023-02-02 15:53 出处:网络
I got some generic razor (view engine) views in a class library that I want to load through a VirtualPathProvider.

I got some generic razor (view engine) views in a class library that I want to load through a VirtualPathProvider.

Everything works great unless I add .sv or .en to the view names (for example MyView.en.cshtml). By doing so it seems like Visual Studio compiles the views into resource DLLs.

Can I prevent that?

Having to load resource DLL's in my VirtualPathProvide开发者_C百科r seems like a hassle. One thread might want to access Swedish views while the other want's English views.


I renamed the views to XXXXX._langCode.cshtml (as in details._sv.cshtml). I then renamed them back in my VirtualPathProvider before returning them.

Works, but not really a solution to the problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消