开发者

Deploy SL4 application with localized DLL imports

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 m开发者_Go百科anually add it in the compiled XAP under folder fr, it is ignored and the application falls back to its neutral culture...


I think I found it, here's a recap for whom may be interested:

  1. 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>.

  2. (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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜