Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any performance difference in using .resx file and satellite assembly?

Tags:

Which is the best way to go forward while building a localized aspx web application, .resx files of satellite assemblies? Is there any performance comparisons available any where on web?

like image 688
Vijesh VP Avatar asked Sep 28 '08 07:09

Vijesh VP


People also ask

What is a satellite assembly and how it is being used?

A satellite assembly is a .NET Framework assembly containing resources specific to a given language. Using satellite assemblies, you can place resources for different languages in different assemblies, and the correct assembly is loaded into memory only if the user selects to view the application in that language.

How do I get .resx file strings in asp net core?

Create a folder in whatever project you want to store the resx files in - default, call it "Resources". Create a new resx file with the specific culture and the file name you'll look up later: If you had a shared one, you could do: SharedResource. en-US. resx.

What is resources Resx?

resx resource file format consists of XML entries that specify objects and strings inside XML tags. One advantage of a . resx file is that when opened with a text editor (such as Notepad) it can be written to, parsed, and manipulated.


1 Answers

Well I don't know if the comparison is valid..

ResX is a storage format for storing resources in XML. It gets compiled to a binary form (.resources) with the resgen tool before it gets embedded (if so specified) into the assembly.

Satellite assembly is a diff/delta of your main assembly resources and your localized resources. So if you have a Strings.resx with 100 strings in MainAssembly.dll of which 10 change in French Canadian Culture, you should have a MainAssembly.resources.dll (satellite assembly) containing just those 10 strings in the fr-CA subdirectory of the DLL folder. When you query for a string resource using a ResourceManager, it takes into account current culture. If fr-CA, it will first look for the string in the satellite assembly in the fr-CA folder, if not found it will fall back to the resources in the DLL itself and return that. The mechanism is to search for it in the following order always.

  - [fr-CA subfolder]\MyAssembly.resources.dll 
  - [fr subfolder]\MyAssembly.resources.dll 
  - DLL itself

For more details, check out http://www.dotneti18n.com/ or the Resources chapter of 'Programming WPF'

like image 170
Gishu Avatar answered Sep 27 '22 20:09

Gishu