. net资源文件绑定区域性错误
本文关键字:区域性 错误 绑定 源文件 资源 net | 更新日期: 2023-09-27 18:10:37
我是。net主题的新手。我创建了一些使用语言资源文件的表单。在绑定过程中发生了以下情况,我不知道"de-DE"语言设置在哪里
默认日志类别:
*** Assembly Binder Log Entry (8/28/2015 @ 4:40:24 PM) ***
The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from: C:'Windows'Microsoft.NET'Framework'v4.0.30319'clr.dll
Running under executable C:'Program Files (x86)'Prg'sample.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = MyForms.1.41.resources, Version=0.0.0.0, Culture=de-DE, PublicKeyToken=xxxxxxxxxx
(Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/ Prg/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = sample.exe
Calling assembly : MyForms.1.41, Version=0.0.0.0, Culture=neutral, PublicKeyToken= xxxxxxxxxx.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:'Program Files (x86)'Prg'sample.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:'Windows'Microsoft.NET'Framework'v4.0.30319'config'machine.config.
LOG: Post-policy reference: MyForms.1.41.resources, Version=0.0.0.0, Culture=de-DE, PublicKeyToken= xxxxxxxxxx
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Prg/de-DE/MyForms.1.41.resources.DLL.
LOG: All probing URLs attempted and failed.
现在我有需要的文件位于"de"目录下,而不是在"de- de"目录下的URL搜索!
我还在MyForms.1.41上调用了带有/culture:de标志的Al.exe。有资源却没有快乐。
任何帮助都是感激的。
我不能使用目录" de- de ",所以不可能覆盖目录名,必须使用" de "。Thx .
似乎有可能以编程方式设置资源文件的文化:
Thread.CurrentUICulture Property
如MSDN中所述。
在我的例子中,默认区域性设置为de-DE,当前区域性是从reg key读取的。不幸的是,缺少regg键,因此使用默认键。欢呼声…