Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Single-Assembly multi-language winforms deployment (ilmerge and satellite assemblies) - possible?

181 views
Skip to first unread message

Maniaque

unread,
Dec 23, 2009, 9:04:33 AM12/23/09
to
I have a simple Windows Forms (C#, .Net 2.0) application, built with
VS2008.

I would like to support multiple UI languages, and using the
"Localizable" property of the form, and culture-specific resx files,
the localization aspect works seamlessly and easily. VS automatically
compiles the culture-specific resx files into satellite assemblies, so
in my compiled application folder there are culture-specific
subfolders containing these satellite assemblies.

I would like to have the application be deployed (copied into place)
as a single assembly, and yet retain the ability to contain multiple
sets of culture-specific resources.

Using ILMerge, I can merge the satellite assemblies into the main
executable assembly, but the standard .Net ResourceManager fallback
mechanisms do not find the culture-specific resources that were
compiled into the main assembly.

Interestingly, if I take my merged (executable) assembly and place
copies of it into the culture-specific subfolders, then everything
works! Similarly, I can see the main and culture-specific resources in
the merged assemby when I use Reflector. But copying the main assembly
into culture-specific subfolders defeats the purpose of the merging
anyway - I really need there to be just a single copy of the single
assembly...

I'm wondering whether there is any way to hijack or influence the
ResourceManager fallback mechanisms to look for the culture-specific
resources in the same assembly rather than in the GAC and culture-
named subfolders. I see the fallback mechanism described in the
following articles, but no clue as to how it would be modified:
http://blogs.msdn.com/bclteam/archive/2009/02/16/working-with-the-resourcemanager-kim-hamilton.aspx

Does anyone have any idea? This seems to be a relatively frequent
question online, but I have not found any authoritative answer
anywhere.

Thanks,
Tao

0 new messages