|
My Application name is Test App 2, and the resource file is Resource.nl-NL. Its full directory structure is C:\Users\admin\Documents\Visual Studio 2005\Projects\Test App 2\Test App 2\Prope
rties\Resource Set\Resource.nl-NL.resources.
Resgen works perfectly. However, on using the Assembly Linker tool with the following command,
al /t:lib /embed:"Resource.nl-NL.resources, Test_App_2.Resour
ce.nl-NL.resources" /culture:"nl-NL" /out:"Test_App_2.resource.dll"
However, i get the following error.
ALINK: error AL1022: Error reading embedded resource
'c:\Users\admin\Documents\Visual Studio 2005\Projects\Test App 2\Test
App 2\Properties\Resource Set\Resource.nl-NL.resources,
Test_App_2.Resource.nl-NL.resources' -- The system cannot find the file
specified.
My application namespace is Test_App_2, as i found out from the project in Visual Studios.
I would really appreciate if you could help me.
Thanks a ton.
|
|
|
|
|
That is so stupid, yet painful problem. To resolve this, you just need to remove space after comma, i.e. change:
/embed:"Resource.nl-NL.resources,[SPACE]Test_App_2.Resour
ce.nl-NL.resources"
to
/embed:"Resource.nl-NL.resources,Test_App_2.Resour
ce.nl-NL.resources"
|
|
|
|
|
Hi,
I am developing a business application iwth silverlight. I have tried localization from your article. Its fine.
but my requirment is not just in displaying labels and texblocks.
I want all details reading from database also to be in local language( or the language user chooses)
i want multi language support for my silverlight application
Pls help.
Manju
|
|
|
|
|
I tried both approaches, IMO al.exe cannot do the job correctly (or these internet-based instructions were wrong on how to link .resources file with appropriate assembly when producing dll file), correct me (or them) if I'm wrong.
Under http://msdn.microsoft.com/en-us/library/y99d1cd3(VS.71).aspx#[^], it is clearly stated how to manually add resource files to the project and edit them. More importantly, it is explained how to properly link resources with main assembly( new ResourceManager("...",typeof(Form1).Assembly); ), so you don't have to worry about faulty batch files when doing approaches 1 or 2.
Approach No.1 ( Assembly.GetExecutingAssembly() ) - has anybody made it at all?
Approach No.2 doesn't even have default (fallback) resource, so you have to worry about that also when shipping your app!
I suggest to let Visual Studio to do the job for you, it works out of the box, no pain.
|
|
|
|
|
What can i do if application is not has any form?
|
|
|
|
|
I made all the steps for building resource files with resgen.exe and al.exe and when I execute it locally in debug with VS2008 (3.5 framework target), everything is fine. My messages are translated without any problems. But when I publish my wcf services and asp.net application on a windows 2003 server with IIS 6.0, I get this error after a certain amount of time of inactivty, when I try to reload the same page. Anybody has an idea about this issue? I fetch my resource value with the "ResourceManager" object, with the GetString() method.
Thanks
below is the error :
========================================================================================
Server Error in '/' Application.
Could not load file or assembly 'ADP.PayConnexion.Business.Messages, Version=1.0.0.0, Culture=en, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'ADP.PayConnexion.Business.Messages, Version=1.0.0.0, Culture=en, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'ADP.PayConnexion.Business.Messages, Version=1.0.0.0, Culture=en, PublicKeyToken=null' could not be loaded.
=== Pre-bind state information ===
LOG: User = NT AUTHORITY\NETWORK SERVICE
LOG: DisplayName = ADP.PayConnexion.Business.Messages, Version=1.0.0.0, Culture=en, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///D:/ADP/PayConnexion_2008/UI/Web/
LOG: Initial PrivatePath = D:\ADP\PayConnexion_2008\UI\Web\bin
Calling assembly : ADP.PayConnexion.UI.Web, Version=1.0.0.0, Culture=en, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\ADP\PayConnexion_2008\UI\Web\web.config
LOG: Using host configuration file: \\?\c:\windows\microsoft.net\framework\v2.0.50727\aspnet.config
LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: The same bind was seen before, and was failed with hr = 0x80070002.
|
|
|
|
|
Extract strings from code to resx and translate their automatically. Try RGreatEx[^] free.
|
|
|
|
|
I tried linking satellite assembly using the first way, but it doesn't work . The second way is pretty straight forward and it works fine. I am using VS2005. I am able to make the dll using Al.exe. Is this approach working for anyone else??
Cheers!!
|
|
|
|
|
Hi. I follow the B solution steps, but I put the resource files on another project inside the same solution. The system works fine, but I got the following error when I compile the resources project:
C:\Projetos\vs2k5\MDI\Idiomas\MDI.Designer.cs(38,25): error CS0234: The type or namespace name 'ComponentModel' does not exist in the namespace 'System' (are you missing an assembly reference?)
C:\Projetos\vs2k5\MDI\Idiomas\MDI.Designer.cs(53,25): error CS0234: The type or namespace name 'ComponentModel' does not exist in the namespace 'System' (are you missing an assembly reference?)
C:\Projetos\vs2k5\MDI\Idiomas\MDI.Designer.cs(22,21): error CS0234: The type or namespace name 'CodeDom' does not exist in the namespace 'System' (are you missing an assembly reference?)
Thats the code:
<br />
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]<br />
<br />
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]<br />
<br />
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]<br />
Using VC2005
Thanks
Valmir Cinquini
Notepad MVP
|
|
|
|
|
I kept getting AL1047 linker errors until I changed the linkder line to:
Al.exe /t:lib /embed:MyResource.en-GB.resources /culture:en-GB /out:MyApplication.resources.dll
|
|
|
|
|
Hello,
I've created a satellite assembly using approach A but it's not working.
I have no error but the strings that are to be read from the resource are coming up empty.
I don't know what I am doing wrong.
|
|
|
|
|
Hello Prakash,
I have tried both the options you have mentioned here in article. Second works fine but is not recommended by Microsoft.
The error I get while using Satellite assembly:
"Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Resource.resources" was correctly embedded or linked into assembly "App_Web_prvhcn9b" at compile time, or that all the satellite assemblies required are loadable and fully signed."
I am very frustated now and not able to proceed in my work as I have already spent my 1 week now on solving this issue. Please help in this matter urgently.
Regards,
Ruchi Shivnani
modified on Wednesday, April 9, 2008 2:57 AM
|
|
|
|
|
Hello,
Can anyone help on this issue.
Ruchi
|
|
|
|
|
I'v got the same issue. Can anybody help?
|
|
|
|
|
A have the same problem and the same exception. In my case it is nesessary to set the correct name of the resource file.The name should be <appname>.<file_of_resources_name> when you create the ResourceManager.
|
|
|
|
|
Friends i am also having the same problem can anyone help me.
- Lenin
|
|
|
|
|
Using resource files we can maintain different versions of languages/strings.
how to convert the data grid data(reading from database) which is entered in english and show it to the end user in different cultures, if i have a dropdown of culture names.
|
|
|
|
|
I've been using StringDB .net for a while, and it has a handy Translate() function. By using this you can translate your default strings to the languages in your language pack. You can get it from www.swbox.com
|
|
|
|
|
Hi all
I developed website in asp.net using c# in English and Arabic languages using localization and resource file, application run good in both language. But the problem that appearance of controls like textboxs or labels become bad after changing language I don't know why.waiting ur help.
|
|
|
|
|
Hi,
A very good article.
I have tried both options. The second one is working fine. However in case of the first one it is always returning the values from the default resx (MyResource.resx) file, even though I have created a satellite assembly for en-GB. Please help...
Regards,
Prashanth
|
|
|
|
|
Same problem here, only second version works. I use VS2008, and put the MyApplication.resources.dll file in Debug/en-GB/ subfolder. What's going wrong?
|
|
|
|
|
Hi,
I am hoping someone can help me...
I have a combo box dropdown style on a form that I want to localise.
I am trying to find the code to load the resource file.
For instance the code for a label called Component List is:
this.label1.Text = res.GetString("Component List");
How do I do this for a combo box with a collection:
blue
red
yellow
Any help is greatly appreciated.
Thanks in advance
|
|
|
|
|
This is more of a combo box question than a resource question.
One way to handle it would to have a single resource string, delimited by some character such as semicolon. In this case, your resource string would be "blue;red;yellow"
When loading your form, you'd init the combo box, with something like
string[] colors = res.GetString("ColorList").Split(new char[] { ';' });
foreach (string color in colors)
yourCombo.Items.Add(color);
They key takeaway here, I would think, would be to encode your list as a single string entry.
|
|
|
|
|
Hi! In the /embed option of the al.exe utility no spaces are allowed between the first and the second path. Otherwise, the AL utility will throw an error.
|
|
|
|
|
hi,
there's also another issue involving a space non needed:
in the constructor of the ResourceManager
new ResourceManager("MyApplication.MyResource "<--- this space prevent the correct loading of the resource
|
|
|
|