【问题标题】:ASP.Net MVC Merge resources from assembly with external resourcesASP.Net MVC 将程序集中的资源与外部资源合并
【发布时间】:2015-11-02 23:26:25
【问题描述】:

我有一个包含逻辑结构的所有资源的程序集 使用约定优于配置。

[My.Resources]
 - [Controller]
    - [View]
        - Strings.resx
        - Strings.fr.resx
        - Strings.nl.resx
 - [Controller]
    - [View]
        - Strings.resx
        - Strings.fr.resx
        - Strings.nl.resx
    - [View]
        - Strings.resx
        - Strings.fr.resx
        - Strings.nl.resx
...

我正在寻找一种自动合并外部资源(自定义 csv 或 resx 文件)的方法 在运行时使用现有资源。 最好使用专用文件夹从同一个程序集中。

感谢您的宝贵时间!

【问题讨论】:

    标签: c# asp.net resources


    【解决方案1】:

    您可以创建 ResourceManager 的实例,然后使用其 CreateFileBasedResourceManager() 方法从外部 .resx 文件中读取资源。

    【讨论】:

    • 这是我的第一个想法,但我想知道如何与基于文件的资源合并并按原样提供资源..?
    猜你喜欢
    • 1970-01-01
    • 2016-12-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-01
    • 2011-02-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多