Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/261.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 从其他dll中的resx获取ressource_C#_Embedded Resource_Resx - Fatal编程技术网

C# 从其他dll中的resx获取ressource

C# 从其他dll中的resx获取ressource,c#,embedded-resource,resx,C#,Embedded Resource,Resx,我在dll中有一个resx文件,其中包含法语和英语的翻译。ressource文件是公共的。 当我在设置currentThread后访问类A中的ressource时 Ressource.LibelleHead 我有英文版或法文版 现在我在动态链接库B中使用动态链接库A,在动态链接库B中设置线程,并使用法语线程调用相同的ressourceressource.LibelleHead,但我总是得到一些结果:英语 如何解决此问题?我打赌该呼叫正在通过您当前的线程进行。您是否尝试过设置Thread.Cur

我在dll中有一个resx文件,其中包含法语和英语的翻译。ressource文件是公共的。 当我在设置currentThread后访问类A中的ressource时

Ressource.LibelleHead
我有英文版或法文版

现在我在动态链接库B中使用动态链接库A,在动态链接库B中设置线程,并使用法语线程调用相同的ressource
ressource.LibelleHead
,但我总是得到一些结果:英语


如何解决此问题?

我打赌该呼叫正在通过您当前的线程进行。您是否尝试过设置
Thread.CurrentCulture=“fr”

您需要设置断点并逐步查找结果。答案可能在ResourceManager自动生成的程序集A类中,它的代码非常简单。但首先检查调用线程的CurrentCulture和CurrentUICulture,可以根据线程的区域性来选择语言。

当我在dll A中用法语设置线程时,这没关系,但在B中使用dll A并设置法语线程时,我始终使用英语。您可以在访问Resource.LibeleHead并检查主线程的CurrentCulture属性之前中断吗?也许是什么原因让它回到了默认的文化。