Resource File question

  • Thread starter Thread starter Jon Pope
  • Start date Start date
J

Jon Pope

I'm working on globalizing my C# executable. I'm doing this by creating a
resource file for each culture (ie appname.fr-FR.resx, etc). This compiles
into appname.fr-FR.resources.dll.

In other discussions, I've seen reference to resgen.exe which produces a
file named appname.fr-FR.resources.

What is the difference between these two files? Which one should I use
within my app?

Cheers, Jon
 
Jon,
Are you using a proprietary file structure or something
that others programs may read and use in their
applications alread existing? If it is going to just
exist in your application, use what makes sense to you,
but if you are making a standard or following a standard,
then use what the standard dictates.
 
The .resources file contains your compiled resources (and can be compiled manually using the resgen tool). The .resources file in turn is embedded into an assembly (the DLL). So in your case, appname.fr_FR.resource.dll is simply the satellite assembly containing the compiled resource file appname.fr-FR.resources. You can take a look at the assemply by using the intermediate language disassembler (ildasm.exe). If you look at the assembly manifest, you will see the ..resources file which has been embedded into the assembly.

When you build your project in Visual Studio, both of these steps are performed automatically. The .resources file is created and embedded into the DLL. You can do this manually as well by using the resgen tool to compile your .resx to get your .resources file, and then using the assembly linker tool (al.exe) to create a satellite assembly and embed the resources. In this case, you have to specify the embedded file(s), the culture, the output file name, and a number of other options. What this means, of course, is that you can later add other languages without having to rebuild your project.

So in answer to your question, you need to use the satellite assembly, but the DLL contains an embedded .resources file. I hope that makes sense.
 
Back
Top