【问题标题】:Specify Culture Name for Resource File in Asp.NET MVC在 Asp.NET MVC 中为资源文件指定区域性名称
【发布时间】:2017-02-11 15:27:23
【问题描述】:

当我尝试创建一个名为 Labels.resx 的资源文件时,它工作正常并且 Labels.designer.cs 被创建得很好,但是当我尝试为特定语言环境创建另一个资源文件时,例如 Labels.en-US.resx 资源文件被损坏并且设计师将是空的!

[从 cmets 编辑]:为 .resx 文件指定的资源生成器是 GlobalResourceProxyGenerator

有什么问题吗?我做错什么了吗?

【问题讨论】:

  • 试试“Labels.en.resx”
  • 它没有改变@levent
  • 你能检查 resx 文件的属性,那里指定了什么工具吗?我想你也可以Run custom tool 看看输出中是否显示任何错误(designer.cs 文件保持为空的最可能原因)
  • 它是GlobalResourceProxyGenerator @Alexei
  • @Hooman - 使用GlobalResourceProxyGenerator 有什么特别的原因吗?我一直使用PublicResXFileCodeGenerator生成资源文件,没有任何问题。

标签: c# asp.net-mvc culture corrupt resource-file


【解决方案1】:

基于cmets,解决方案是使用另一个资源生成器:

PublicResXFileCodeGenerator 

而不是

GlobalResourceProxyGenerator

【讨论】:

    猜你喜欢
    • 2012-10-31
    • 1970-01-01
    • 2011-11-01
    • 2023-03-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-07
    • 1970-01-01
    相关资源
    最近更新 更多