Load an Satellite-Assembly

  • Thread starter Thread starter Rudolf Ball
  • Start date Start date
R

Rudolf Ball

Dear NG,

i want to load a plugin (WinForm) in my Applikation. That works fine. Now I
want to globalize that plugin. So I have to load the Satellite Assembly, as
well. But how can I load this (and when?).

Thank you very much

Rudi
 
Hello Rudolf,

From what I know about satellite assemblies, they should be loaded
automatically by the .NET Framework when you request resources for the
corresponding culture. The trick is to deploy these assemblies to the
correct location and with correct names - to be exact, to a folder named
exactly as the culture abbreviation (e.g. de-de or en-us), being sub-folder
of the folder containing the plug-in DLL.

So the folder structure will be like this:

application.exe
somelibrary.dll
Plug-ins\
SomePlug-in\
SomePlugin.dll
de-DE\
SomePlugin.de-DE.dll
en-AU
SomePlugin.en-AU.dll
fr-FR
SomePlugin.fr-FR.dll

I'd also suggest reviewing the corresponding sections of MSDN Library as my
memory is not ideal and I could miss something.
 
Dear Dmitriy,

thank you very much, but I have done this.
My structure is exactly like yours (folders de-DE, de-AT, en-US).
I load the assembly like this:

Assembly ControlLib;
PlugIn newPlugin;

ControlLib = Assembly.LoadFrom(Location);
newPlugin = (PlugIn)ControlLib.CreateInstance(ControlName);
MainPanel.Controls.Add(newPlugin);

this works fine, but the internationalized Plugin with the Satellite
Assemblies does not change the language. At Startup I change the
CurrentUICulture to "de-AT", but my Plugin uses always the Standard.

Thanx for your help

Rudi



Dmitriy Lapshin said:
Hello Rudolf,

From what I know about satellite assemblies, they should be loaded
automatically by the .NET Framework when you request resources for the
corresponding culture. The trick is to deploy these assemblies to the
correct location and with correct names - to be exact, to a folder named
exactly as the culture abbreviation (e.g. de-de or en-us), being sub-folder
of the folder containing the plug-in DLL.

So the folder structure will be like this:

application.exe
somelibrary.dll
Plug-ins\
SomePlug-in\
SomePlugin.dll
de-DE\
SomePlugin.de-DE.dll
en-AU
SomePlugin.en-AU.dll
fr-FR
SomePlugin.fr-FR.dll

I'd also suggest reviewing the corresponding sections of MSDN Library as my
memory is not ideal and I could miss something.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Unit Testing and Integration Environment
http://x-unity.miik.com.ua
Deliver reliable .NET software

Rudolf Ball said:
Dear NG,

i want to load a plugin (WinForm) in my Applikation. That works fine.
Now
I
want to globalize that plugin. So I have to load the Satellite Assembly, as
well. But how can I load this (and when?).

Thank you very much

Rudi
 
Rudolf,

How do you load localizable resources in your plug-in (from your sample I
can judge it is actually a Windows Forms User Control)? Do you use
'Localizable' property in your custom controls?

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Unit Testing and Integration Environment
http://x-unity.miik.com.ua
Deliver reliable .NET software

Rudolf Ball said:
Dear Dmitriy,

thank you very much, but I have done this.
My structure is exactly like yours (folders de-DE, de-AT, en-US).
I load the assembly like this:

Assembly ControlLib;
PlugIn newPlugin;

ControlLib = Assembly.LoadFrom(Location);
newPlugin = (PlugIn)ControlLib.CreateInstance(ControlName);
MainPanel.Controls.Add(newPlugin);

this works fine, but the internationalized Plugin with the Satellite
Assemblies does not change the language. At Startup I change the
CurrentUICulture to "de-AT", but my Plugin uses always the Standard.

Thanx for your help

Rudi



Dmitriy Lapshin said:
Hello Rudolf,

From what I know about satellite assemblies, they should be loaded
automatically by the .NET Framework when you request resources for the
corresponding culture. The trick is to deploy these assemblies to the
correct location and with correct names - to be exact, to a folder named
exactly as the culture abbreviation (e.g. de-de or en-us), being sub-folder
of the folder containing the plug-in DLL.

So the folder structure will be like this:

application.exe
somelibrary.dll
Plug-ins\
SomePlug-in\
SomePlugin.dll
de-DE\
SomePlugin.de-DE.dll
en-AU
SomePlugin.en-AU.dll
fr-FR
SomePlugin.fr-FR.dll

I'd also suggest reviewing the corresponding sections of MSDN Library as my
memory is not ideal and I could miss something.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Unit Testing and Integration Environment
http://x-unity.miik.com.ua
Deliver reliable .NET software

Rudolf Ball said:
Dear NG,

i want to load a plugin (WinForm) in my Applikation. That works fine.
Now
I
want to globalize that plugin. So I have to load the Satellite
Assembly,
as
well. But how can I load this (and when?).

Thank you very much

Rudi
 
Yes, i do this. But it doesn`t work.
What alternative possibilities do I have?


Dmitriy Lapshin said:
Rudolf,

How do you load localizable resources in your plug-in (from your sample I
can judge it is actually a Windows Forms User Control)? Do you use
'Localizable' property in your custom controls?

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Unit Testing and Integration Environment
http://x-unity.miik.com.ua
Deliver reliable .NET software

Rudolf Ball said:
Dear Dmitriy,

thank you very much, but I have done this.
My structure is exactly like yours (folders de-DE, de-AT, en-US).
I load the assembly like this:

Assembly ControlLib;
PlugIn newPlugin;

ControlLib = Assembly.LoadFrom(Location);
newPlugin = (PlugIn)ControlLib.CreateInstance(ControlName);
MainPanel.Controls.Add(newPlugin);

this works fine, but the internationalized Plugin with the Satellite
Assemblies does not change the language. At Startup I change the
CurrentUICulture to "de-AT", but my Plugin uses always the Standard.

Thanx for your help

Rudi



in message news:[email protected]...
Hello Rudolf,

From what I know about satellite assemblies, they should be loaded
automatically by the .NET Framework when you request resources for the
corresponding culture. The trick is to deploy these assemblies to the
correct location and with correct names - to be exact, to a folder named
exactly as the culture abbreviation (e.g. de-de or en-us), being sub-folder
of the folder containing the plug-in DLL.

So the folder structure will be like this:

application.exe
somelibrary.dll
Plug-ins\
SomePlug-in\
SomePlugin.dll
de-DE\
SomePlugin.de-DE.dll
en-AU
SomePlugin.en-AU.dll
fr-FR
SomePlugin.fr-FR.dll

I'd also suggest reviewing the corresponding sections of MSDN Library
as
my
memory is not ideal and I could miss something.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Unit Testing and Integration Environment
http://x-unity.miik.com.ua
Deliver reliable .NET software

Dear NG,

i want to load a plugin (WinForm) in my Applikation. That works
fine.
Now
I
want to globalize that plugin. So I have to load the Satellite Assembly,
as
well. But how can I load this (and when?).

Thank you very much

Rudi
 
Hi,

As a guess - try moving all the satellite assemblies from their sub-folders
in the Plugins directory to the corresponding sub-folders of the main
application directory. I have a feeling that the Framework probes for
satellite assemblies in sub-folders of the main application directory (as
far as I remember there are several AppDomain-level settings that govern the
probing process).

It should result in a structure like this:

MyApp\
MyApp.exe
SomeLibrary.dll
Plugins\
MyPlugin.dll
fr-FR\
MyPlugin.fr-FR.dll
de-DE\
MyPlugin.de-DE.dll

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Unit Testing and Integration Environment
http://x-unity.miik.com.ua
Deliver reliable .NET software

DotNetJunkie said:
Yes, i do this. But it doesn`t work.
What alternative possibilities do I have?


Dmitriy Lapshin said:
Rudolf,

How do you load localizable resources in your plug-in (from your sample I
can judge it is actually a Windows Forms User Control)? Do you use
'Localizable' property in your custom controls?

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Unit Testing and Integration Environment
http://x-unity.miik.com.ua
Deliver reliable .NET software

Rudolf Ball said:
Dear Dmitriy,

thank you very much, but I have done this.
My structure is exactly like yours (folders de-DE, de-AT, en-US).
I load the assembly like this:

Assembly ControlLib;
PlugIn newPlugin;

ControlLib = Assembly.LoadFrom(Location);
newPlugin = (PlugIn)ControlLib.CreateInstance(ControlName);
MainPanel.Controls.Add(newPlugin);

this works fine, but the internationalized Plugin with the Satellite
Assemblies does not change the language. At Startup I change the
CurrentUICulture to "de-AT", but my Plugin uses always the Standard.

Thanx for your help

Rudi



in message Hello Rudolf,

From what I know about satellite assemblies, they should be loaded
automatically by the .NET Framework when you request resources for the
corresponding culture. The trick is to deploy these assemblies to the
correct location and with correct names - to be exact, to a folder named
exactly as the culture abbreviation (e.g. de-de or en-us), being
sub-folder
of the folder containing the plug-in DLL.

So the folder structure will be like this:

application.exe
somelibrary.dll
Plug-ins\
SomePlug-in\
SomePlugin.dll
de-DE\
SomePlugin.de-DE.dll
en-AU
SomePlugin.en-AU.dll
fr-FR
SomePlugin.fr-FR.dll

I'd also suggest reviewing the corresponding sections of MSDN
Library
as
my
memory is not ideal and I could miss something.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Unit Testing and Integration Environment
http://x-unity.miik.com.ua
Deliver reliable .NET software

Dear NG,

i want to load a plugin (WinForm) in my Applikation. That works fine.
Now
I
want to globalize that plugin. So I have to load the Satellite Assembly,
as
well. But how can I load this (and when?).

Thank you very much

Rudi
 
Back
Top