Localization problem

Y

Yoavo

Hi,
I am trying to localize my application but I have some difficulties doing
it.
In my application I need to load the translated resource from a specific
folder (that the user determine using the command line argument ).
My application contains an .exe with a form with buttons which their text is
taken from a DLL.
The DLL was translated and the satellite translated dll is placed in a
certain folder.
In the code I load the translated file to an Assembly, create a
ResourceManager from this Assembly, and try to get the text using GetString
method.
I get an exception when calling GetString method.

This is my code:
string aResourceFile = System.IO.Path.Combine(mResourcePath,
"TestRC.resources.dll");
System.Reflection.Assembly ResourceAssembly =
System.Reflection.Assembly.LoadFile(aResourceFile);
ResourceManager rm = new ResourceManager("TestRC",
ResourceAssembly);
string res= rm.GetString(iName);
return res;

When calling to GetString I get a
System.Resources.MissingManifestResourceException:
"Additional information: Could not find any resources appropriate for the
specified culture or the neutral culture. Make sure "TestRC2.resources" was
correctly embedded or linked into assembly "TestRC2.resources" at compile
time, or that all the satellite assemblies required are loadable and fully
signed."

Can someone please help or advice?
thanks,

Yoav.
 
U

unnikrishnan

Hi,
I am trying to localize my application but I have some difficulties doing
it.
In my application I need to load the translated resource from a specific
folder (that the user determine using the command line argument ).
My application contains an .exe with a form with buttons which their text is
taken from a DLL.
The DLL was translated and the satellite translated dll is placed in a
certain folder.
In the code I load the translated file to an Assembly, create a
ResourceManager from this Assembly, and try to get the text using GetString
method.
I get an exception when calling GetString method.

This is my code:
            string aResourceFile = System.IO.Path.Combine(mResourcePath,
"TestRC.resources.dll");
            System.Reflection.Assembly ResourceAssembly =
System.Reflection.Assembly.LoadFile(aResourceFile);
            ResourceManager rm = new ResourceManager("TestRC",
ResourceAssembly);
            string res= rm.GetString(iName);
            return res;

When calling to GetString I get a
System.Resources.MissingManifestResourceException:
"Additional information: Could not find any resources appropriate for the
specified culture or the neutral culture.  Make sure "TestRC2.resources"was
correctly embedded or linked into assembly "TestRC2.resources" at compile
time, or that all the satellite assemblies required are loadable and fully
signed."

Can someone please help or advice?
thanks,

Yoav.

Hi Yoav,

Are you getting the error when you debug or while you are running? If
you have a statellite assembly, I would suggest running al.exe to
combine the satelite assembly to the running program so that it knows
where to find it. Take a look at al.exe in the microsoft web site.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top