使用本地化 DLL 导入部署 SL4 应用程序
我有一个 VS2010 SL4 项目,它使用外部 Silverlight DLL。该项目使用多个 RESX 文件进行本地化,DLL 也是如此。我通常在我的解决方案中包含外部 DLL,如下所示:
1)在我的解决方案中创建一组虚拟文件夹(假设导入的 DLL 名为 Sample.dll):
/Lib/Sample/Debug
/Lib/Sample/Release
2)在文件系统中创建相同的文件夹结构并在“调试”下复制并发布 DLL 的相应版本,以便现在我找到以下文件:
/Lib/Sample/Debug/Sample.dll
/Lib/Sample/Release/Sample.dll
3) 向解决方案中的所有客户端项目添加对 /Lib/Sample/Debug/Sample.dll 的引用。
4)打开添加了引用的每个项目的.csproj文件,并将路径的Debug部分更改为$(Configuration),以便正确的Debug/Release版本是在构建过程中选择的。
现在的问题是:在我的 SL4 解决方案中,我可以遵循相同的过程来导入语言中立的 DLL。但它的卫星资源呢?例如,导入的 DLL 的法语版本构建在子文件夹 fr-FR 下,并命名为 Sample.resources.dll。我应该如何正确地包含它?即使我尝试将其手动添加到文件夹 fr 下的已编译 XAP 中,它也会被忽略,并且应用程序会回退到其中性文化...
I have a VS2010 SL4 project which uses an external Silverlight DLL. The project is localized with multiple RESX files, and the DLL is, too. I usually include external DLLs in my solutions as follows:
1) create a set of virtual folders in my solution like (say the imported DLL is named Sample.dll):
/Lib/Sample/Debug
/Lib/Sample/Release
2) create the same folders structure in the file system and copy under Debug and Release the respective versions of the DLL, so that now I find the following files:
/Lib/Sample/Debug/Sample.dll
/Lib/Sample/Release/Sample.dll
3) add to all the client projects in the solution a reference to /Lib/Sample/Debug/Sample.dll.
4) open the .csproj file of each project with the added reference, and change the Debug part of the path with $(Configuration), so that the right Debug/Release version is picked during build.
Now the question is: in my SL4 solution I can follow the same procedure for importing the language-neutral DLL. But what about its satellite resources? For instance, the French version of the imported DLL is built under subfolder fr-FR and named Sample.resources.dll. How should I include it correctly? Even If I try to manually add it in the compiled XAP under folder fr, it is ignored and the application falls back to its neutral culture...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想我找到了,这里是可能感兴趣的人的回顾:
打开.csproj文件并确保在中添加所有所需的语言(用分号分隔) >。例如,如果您支持fr-Fr,请添加fr-Fr 。
(必须手动执行此操作,我认为 1. 应该足够了):编译后,打开 xap(将其重命名为 .zip 并打开),如果不存在则添加一个元素,例如对于每个带有资源的导入卫星。
无论如何,谢谢!
I think I found it, here's a recap for whom may be interested:
open the .csproj file and ensure you add all your desired languages (separated by semicolons) in . For instance, if you support fr-Fr add <SupportedCultures>fr-Fr</SupportedCultures>.
(had to do this manually, I supposed 1. should be enough): once compiled, open your xap (rename it to .zip and open) and add if not present an element like <AssemblyPart Source="fr-FR/Sample.resources.dll" /> for each imported satellite with resources.
Thanks anyway!