【问题标题】:Global Resources and Windows Azure全球资源和 Windows Azure
【发布时间】:2011-08-22 23:07:29
【问题描述】:

我的 ASP.Net 3.5 SP 1 MVC 1.0 Web 应用程序使用多种语言的资源 (resx)。默认语言为英语。

我的资源从当前线程中选择正确的语言,这是我在尝试显示任何资源之前设置的。

System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.GetCultureInfo(Model.CurrentCultureCode);
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture(Model.CurrentCultureCode);

在我开始迁移到 Windows Azure 之前,这一切都很好。

在 Windows Azure 中,虽然 Model.CurrentCultureCode 的值正确,但相同的代码似乎卡在英语上。

还有其他人在迁移到 Windows Azure 时正在尝试类似的事情吗?

【问题讨论】:

    标签: globalization azure


    【解决方案1】:

    我通过将资源文件从它们所在的单独库移动到网站所在的同一个 WebRole 项目来解决了这个问题。我还将资源文件放在 App_GlobalResources 文件夹中。

    虽然我的解决方案现在可以工作,但这并不能解释为什么资源文件在单独的库中不能正常工作。让我知道你是否能解决这个问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-06-12
      • 1970-01-01
      • 1970-01-01
      • 2020-02-13
      • 2022-01-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多