Embedding View files as resource inside Binary

前端 未结 5 1132
不知归路
不知归路 2021-02-06 09:36

I am trying to create a .Net Library with few Controllers, and i want to reuse them in Multiple web projects.

I\'m half way through, But problem i\'m getting is , Whenev

5条回答
  •  既然无缘
    2021-02-06 10:11

    Phil Haack just posted a blog post a few days ago that would probably help you; He's using a database to store the views and ruby to process them, but I would think you could take his prototype and make it work for views stored in a separate assembly fairly easily.

    Just a quick glance through the code and I think the magic sauce is going to be implementing VirtualPathProviderViewEngine (See the "RubyViewEngine" class for example) and inserting your ViewEngine into ViewEngines.Engines Collection (see Global.asax.cs).

提交回复
热议问题