是否有使用.resx文件和卫星组装任何性能差异? [英] Is there any performance difference in using .resx file and satellite assembly?

查看:231
本文介绍了是否有使用.resx文件和卫星组装任何性能差异?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是向前迈进,同时建立一个本地化的ASPX Web应用程序,卫星集.resx文件的最佳方式是什么?是否有任何可用的性能比较任何地方对网络?

解决方案

好吧,我不知道,如果是比较有效的。

的ResX是用于存储资源的XML存储格式。它被编译为二进制形式(的.resources)与RESGEN工具,然后才会慢慢嵌入(若有指定)到组件。

附属程序集是主程序集资源和本地化的资源差异/增量。所以,如果你有一个Strings.resx包含只是那些10串的的FR-CA的子目录100串MainAssembly.dll其中加拿大法语文化10的变化,你应该有一个MainAssembly.resources.dll(附属程序集) DLL文件夹。 当你使用一个ResourceManager查询字符串资源,它考虑到当前的文化。如果FR-CA,它会先查找字符串在FR-CA文件夹中的附属程序集,如果没有找到,将回落到资源DLL本身并返回。该机制是寻找它在总是按下列顺序

   -  [FR-CA的子文件夹] \ MyAssembly.resources.dll
   -  [FR的子文件夹] \ MyAssembly.resources.dll
   -  DLL本身
 

有关详细信息,请查看 http://www.dotneti18n.com/ 或编程WPF<的资源章节/ P>

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?

解决方案

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'

这篇关于是否有使用.resx文件和卫星组装任何性能差异?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆