I am trying using satellite assemblies for localization in WinForms application. The directory structure is as follows:
- bin
- Program.exe
- de
- Program.resources.dll
In the Program.exe, this code is executed in Main
method:
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Thread.CurrentThread.CurrentUICulture = new CultureInfo("de");
Application.Run(new Form());
I checked the FUSLOGVW.exe output:
*** Assembly Binder Log Entry (5/30/2012 @ 5:19:37 PM) *** The operation failed. Bind result: hr = 0x80070002. The system cannot find the file specified. Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll Running under executable D:\tmp\bin\Program.exe --- A detailed error log follows. === Pre-bind state information === LOG: User = paulius_l LOG: DisplayName = Program.resources, Version=1.0.0.0, Culture=de, PublicKeyToken=... (Fully-specified) LOG: Appbase = file:///D:/tmp/bin/ LOG: Initial PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache Base = NULL LOG: AppName = Program.exe Calling assembly : Program, Version=1.0.0.0, Culture=neutral, PublicKeyToken=.... === LOG: Start binding of native image Program.resources, Version=1.0.0.0, Culture=de, PublicKeyToken=.... WRN: No matching native image found. LOG: IL assembly loaded from D:\tmp\bin\de\Program.resources.dll.
This looks fine, however strings just do not get localized -- default strings from the Program.exe are still used.
To get the strings I use Visual Studio-generated Res
class from the Res.resx
.
What am I missing here?
Edit: added full FUSLOGVW output, for those that understand it better than I do.
This was my huge mistake I did when I wrote automated build script which would generate satellite assemblies externally. The problem was that while generating the classes in the satellite assemblies, I missed the
Res
class. No wonder it did not work.After long hours spent, I found the problem this morning.