ASP.NET - How to get assembly from virtual path in custom IResourceProvider implementation

杀马特。学长 韩版系。学妹 提交于 2020-01-05 08:11:04

问题


I'm developing custom local resource provider implementation, which should supply resource values from resources located in App_LocalResources folders, but the resources should be compiled as embedded. So no resx files will stay in web app folder, which default LocalResXResourceProvider expects.

The problem is I need to get to assembly with the embedded resources from virtual path and I'm not able to figure out what ASP.NET class use to translate virtual path to corresponding assembly. I was looking into decompiled sources of LocalResXResourceProvider and BuildManager, but all the things are internal. I wasn't able to get the assembly even using LocalResXResourceProvider.GetLocalResourceAssembly() through reflection - it just returns null when I deployed the application to clear folder without resx files in place. It works when resx files are present though...

来源:https://stackoverflow.com/questions/10533721/asp-net-how-to-get-assembly-from-virtual-path-in-custom-iresourceprovider-impl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!