因此,我的计算机上有Outlook,我将荷兰语包添加到我的计算机中。之后,我在我的C# visual项目中遇到了很多失败的测试。我负责流程验证。当我推动我的代码开发时,我在测试中不会出现错误。所以我很确定问题不在我的代码里,而是在我的电脑上。
因此,我卸载了语言包,仍然得到了错误。
我的一个错误是:
没有找到:UnitKeyName: MaximumLengthValidator -‘UnitKeyName’的长度必须是256个字符或更少。你输入了400个字符。值:验证消息时发生错误: UnitKeyName: MaximumLengthValidator - De lengte van 'Unit Key Name‘moet kleiner zijn dan of gelijk aan 256 tekens。U 400 -tekens ingevoerd.
意思:验证使用错误的语言,但是当我将验证推到GIT分支时,我的同事没有这个错误。
键盘:英语(换回)->它是英语(测试:工作)切换到荷兰语(测试失败)->切换回英语(测试:失败)
发布于 2019-05-14 14:27:27
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US");
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");这做了它//
发布于 2019-05-14 12:35:17
您可以更改当前线程区域性和UI区域性。
CultureInfo newCulture = CultureInfo.CreateSpecificCulture("en-US");
Thread.CurrentThread.CurrentUICulture = newCulture;
Thread.CurrentThread.CurrentCulture = newCulture;https://stackoverflow.com/questions/56130469
复制相似问题