D
Dan
I am creating a c# class library project to be used by some exe clients.
This library needs to be localized for its text messages using satellite
resource-only assemblies; I have created the library with an embedded
resource for the default language and a sample satellite assembly with
strings for another language, plus a dummy test client application, but the
library always falls back to the default resources. Here's what I do: could
anyone tell me what's wrong?
1) I create a new c# class library project, named e.g. Localizable;
2) I add a resource (Strings.resx) file to this project and insert some
string resources in the default language (english): e.g. HELLO = "Hello";
3) outside this project, I 'manually' create another resx file e.g. for
italian named Strings.it.resx (with HELLO = "Ciao");
4) I run RESGEN Strings.it.resx to create Strings.it.resources;
5) I create a satellite assembly with AL:
al /t:lib /culture:it
/embed:Strings.it.resources,Localizable.Strings.it.resources
/out:Strings.resources.dll
6) I create a dummy test console application which uses a resource manager
to get the HELLO string first with the default culture then with the "it"
culture. Assuming that it's named Test.exe, in its directory I place the
Localizable dll and a subfolder (it) with the satellite assembly:
|- Test.exe
|- Localizable.dll
|- it\Strings.resources.dll
When I run Test, the strings always come in english. Could anyone give a
hint?
Here are the MANIFEST for the satellite assembly and the Localizable dll:
==== satellite assembly manifest ====
..assembly Strings.resources
{
.hash algorithm 0x00008004
.ver 0:0:0:0
.locale = (69 00 74 00 00 00 ) // i.t...
}
..mresource public Localizable.Strings.it.resources
{
}
..module Strings.resources.dll
// MVID: {CEB4DAA0-09ED-44AA-88D8-C53C495BD45F}
..imagebase 0x00400000
..subsystem 0x00000003
..file alignment 512
..corflags 0x00000001
// Image base: 0x06e60000
==== library assembly manifest ====
..assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) //
..z\V.4..
.ver 1:0:5000:0
}
..assembly Localizable
{
.... (snip) ...
}
..mresource public Localizable.Strings.resources
{
}
..module Localizable.dll
// MVID: {762391D6-143E-4337-9977-283F628D4491}
..imagebase 0x11000000
..subsystem 0x00000003
..file alignment 4096
..corflags 0x00000001
// Image base: 0x06e60000
This library needs to be localized for its text messages using satellite
resource-only assemblies; I have created the library with an embedded
resource for the default language and a sample satellite assembly with
strings for another language, plus a dummy test client application, but the
library always falls back to the default resources. Here's what I do: could
anyone tell me what's wrong?
1) I create a new c# class library project, named e.g. Localizable;
2) I add a resource (Strings.resx) file to this project and insert some
string resources in the default language (english): e.g. HELLO = "Hello";
3) outside this project, I 'manually' create another resx file e.g. for
italian named Strings.it.resx (with HELLO = "Ciao");
4) I run RESGEN Strings.it.resx to create Strings.it.resources;
5) I create a satellite assembly with AL:
al /t:lib /culture:it
/embed:Strings.it.resources,Localizable.Strings.it.resources
/out:Strings.resources.dll
6) I create a dummy test console application which uses a resource manager
to get the HELLO string first with the default culture then with the "it"
culture. Assuming that it's named Test.exe, in its directory I place the
Localizable dll and a subfolder (it) with the satellite assembly:
|- Test.exe
|- Localizable.dll
|- it\Strings.resources.dll
When I run Test, the strings always come in english. Could anyone give a
hint?
Here are the MANIFEST for the satellite assembly and the Localizable dll:
==== satellite assembly manifest ====
..assembly Strings.resources
{
.hash algorithm 0x00008004
.ver 0:0:0:0
.locale = (69 00 74 00 00 00 ) // i.t...
}
..mresource public Localizable.Strings.it.resources
{
}
..module Strings.resources.dll
// MVID: {CEB4DAA0-09ED-44AA-88D8-C53C495BD45F}
..imagebase 0x00400000
..subsystem 0x00000003
..file alignment 512
..corflags 0x00000001
// Image base: 0x06e60000
==== library assembly manifest ====
..assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) //
..z\V.4..
.ver 1:0:5000:0
}
..assembly Localizable
{
.... (snip) ...
}
..mresource public Localizable.Strings.resources
{
}
..module Localizable.dll
// MVID: {762391D6-143E-4337-9977-283F628D4491}
..imagebase 0x11000000
..subsystem 0x00000003
..file alignment 4096
..corflags 0x00000001
// Image base: 0x06e60000