CRM 2011, ILMerge and localization

I am having problems merging localization assemblies into a plugin DLL for CRM2011.

Either this, or I don’t know how to use the combined resources afterwards.

I create several plugins and create a basic resource file (English by default) and one for a specific culture (at the time of writing it for Polish localizations, but later I also need to add French).

I will not sign the assembly itself, as ILMerge will sign the completed assembly.

This is the command I use to combine the extra satellite assembly:

ilmerge /targetplatform:v4,C:\Windows\Microsoft.NET\Framework\v4.0.30319 /log:log.txt /keyfile:KeyFile.snk /out:Plugins.dll DynamicsCRM2011.Plugins.dll pl-PL\DynamicsCRM2011.Plugins.resources.dll

As you can see, the plugins are in .NET 4.0, and I have the required .config file for ILMerge to use the necessary assemblies for merging.

The generated file looks fine, I can register it using the CRM logger plugin, add new steps, etc.

However, he will always use the default language. I tried to change System.Threading.Thread.CurrentThread.UICulture, but that did not help. When I created the class ResourceManagerand used it GetString("ErrorMessage", new System.Globalization.CultureInfo("pl-PL")), I got Exceptionthat the specified one ResourceManagerdoes not know what to do with the specified culture.

I know about this question here . However, the published solution seems old. Generated .cs files do not use ComponentResourceManager. In addition, portions of the code posted there are deprecated.

I'm not quite sure what to do now, or how to further debug it, since I have very little experience in working with the assemblies themselves. Please help me control these satellite assemblies.


Update:

, , CurrentCulture (, , ). : , . . :

        ResourceManager rm = new ResourceManager(typeof(Properties.Resources));
        var s = rm.GetString("ErrorAlreadyPosted", new System.Globalization.CultureInfo("pl-PL"));
        throw new InvalidPluginExecutionException(s);

- ... , , . , .

, . , GetString, .

, ILmerge, , , /lib, , DLL CRM SDK...

+5
2

-, .

MSDN: http://msdn.microsoft.com/en-us/library/hh670609.aspx#BKMK_UseXMLWebResourcesAsLanguageResources

: , - XML , . XML - , , ASP.NET Resource (.resx), - XML . , - XML localizedString.en_US, , .resx.

, , crm.

+1

, ? , , , .

Thread.CurrentThread.CurrentUICulture \ Thread.CurrentThread.CurrentCulture.

AppDomain.CurrentDomain.AssemblyLoad \ AppDomain.CurrentDomain.AssemblyResolve, , . , , .

, ilmerge.
: http://bartlomiej.net/dotnet/embeded-assembies-into-an-executable/

0

All Articles