|
 |
aspx thread: Localization with Satellite Assemblies in VS.
Message #1 by "Colm Hayden" <colm.hayden@r...> on Fri, 31 Aug 2001 18:12:05 +0100
|
|
Hi,
I have been attempting to build a localized web application and have
been having trouble using satellite assemblies in Visual Studio
Following the Quickstart examples and Framework SDK tutorial I have been
able to create .resources files and access these using
ResourceManager.CreateFileBasedResourceManager().
I have no problems reading localised strings from the .resources files.
However, I would like to use satellite assemblies to avoid file locking,
etc.
I would like to be able to do my final build from Visual Studio, but do
not know how to reference the assemblies
What I have tried:
1 Command-line & VS
1-1. created .resource files and built assemblies placing the assemblies
in the appropriate directories
e.g.
resgen UIStrings.fr-fr.txt UIStrings.fr-fr.resources
al /out:..\bin\fr-fr\UIStrings.Resources.DLL /c:fr-fr
/embed:UIStrings.fr-fr.resources, UIStrings.fr-fr.resources, Private
resulting in
WebDir/
bin/
UIStrings.resources.dll
fr-fr/
UIStrings.fr-fr.resources.dll
1-2. Built the web application as normal
2 VS Only
2.1 - added the .resources files to the WebProject in Solution Explorer
2.2 - built the web app as normal (this seems to add the DLLs to the
appropriate directories (eg. bin/fr-fr))
Please can anyone help me, as I cannot find much info on how to do all
this inside Visual Studio
Thanks in advance,
Colm
Message #2 by "Christian Nagel" <Christian.Nagel@g...> on Fri, 31 Aug 2001 21:51:57 +0200
|
|
Hi Colm,
It took me some time to find it out, but this works:
Build the neutral assembly with the name UIStrings.dll and put it into the
bin directory.
The French satellite assembly must be named UIStrings.resources.dll and put
into the fr directory (do it similar with the other languages). The French
satellite assembly must be built with the al option /culture:fr.
Using Visual Studio .NET all you have to do is add the binary resource files
to the project. The build action of these files is automatically set to
Embedded Resource. For the resource manager use
Assembly.GetExecutingAssembly() to get to the resource. Pay attention to the
resource name needed for the ResourceManager. The namespace of the project
is added, but don't add the resources extension. You can get the resource
name by looking into the manifest using ildasm.
I hope this helps.
Best regards,
Christian
http://christian.nagel.net
Professional C#
----- Original Message -----
From: "Colm Hayden" <colm.hayden@r...>
To: "ASP+" <aspx@p...>
Sent: Friday, August 31, 2001 7:12 PM
Subject: [aspx] Localization with Satellite Assemblies in VS.
Hi,
I have been attempting to build a localized web application and have
been having trouble using satellite assemblies in Visual Studio
Following the Quickstart examples and Framework SDK tutorial I have been
able to create .resources files and access these using
ResourceManager.CreateFileBasedResourceManager().
I have no problems reading localised strings from the .resources files.
However, I would like to use satellite assemblies to avoid file locking,
etc.
I would like to be able to do my final build from Visual Studio, but do
not know how to reference the assemblies
What I have tried:
1 Command-line & VS
1-1. created .resource files and built assemblies placing the assemblies
in the appropriate directories
e.g.
resgen UIStrings.fr-fr.txt UIStrings.fr-fr.resources
al /out:..\bin\fr-fr\UIStrings.Resources.DLL /c:fr-fr
/embed:UIStrings.fr-fr.resources, UIStrings.fr-fr.resources, Private
resulting in
WebDir/
bin/
UIStrings.resources.dll
fr-fr/
UIStrings.fr-fr.resources.dll
1-2. Built the web application as normal
2 VS Only
2.1 - added the .resources files to the WebProject in Solution Explorer
2.2 - built the web app as normal (this seems to add the DLLs to the
appropriate directories (eg. bin/fr-fr))
Please can anyone help me, as I cannot find much info on how to do all
this inside Visual Studio
Thanks in advance,
Colm
|
|
 |