You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

升级Visual Studio 17.11.x后resx文件仅返回中性值求助

Visual Studio 17.11.x升级后多语言resx资源加载异常

将Visual Studio升级至17.11.0或17.11.1版本后,resx文件仅返回中性语言(英语)资源,无法加载波斯语等其他语言的资源。项目包含两个存储多语言resx文件的程序集,一个为通用程序集,另一个为项目专用程序集,此前代码运行正常,升级后仅能返回主语言英语。

Program.cs中的本地化配置代码如下:

builder.Services.AddLocalization(o => o.ResourcesPath = Path.Combine("Resources", "Common"));
builder.Services.AddLocalization(o => o.ResourcesPath = Path.Combine("1.Core", "ContentService", "Resources"));

app.UseRequestLocalization(options =>
{
    var supportedCultures = new[] { "fa-IR", "en-US" };
    options.SetDefaultCulture(supportedCultures[0])
        .AddSupportedCultures(supportedCultures)
        .AddSupportedUICultures(supportedCultures)
        .ApplyCurrentCultureToResponseHeaders = true;
});

另外,使用项目中用于错误处理的Fluent Validation库测试时发现,即便将请求头的Content-Language设为en-US,该库仍仅返回波斯语错误信息,此前该功能运行正常。

请问有人遇到过同类问题吗?或者知道如何解决该问题?

若您也遇到该问题,请在Visual Studio开发者社区的对应讨论帖中投票支持。


内容的提问来源于stack exchange,提问作者arman

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.19 09:21:14