PC Review

Thread Tools Rate Thread

Loading resources from satellite assemblies of reflection loaded assemblies..

Posts: n/a
      23rd Nov 2006
Hi all,

This could get a bit complicated but I'll try to be as clear as
possible. I've written an application that discovers plugins at
runtime using reflection from a subdirectory of the application, eg:

In the directory the application is installed to:


I've successfully generated satellite assemblies for the main
application, these appear as (for example):


All is good so far. The plugins also have resources that need to be
localized, I expected their satellite assemblies to be required under:


However I find that my the ResourceManager class is trying to load them
from the same location as the application satellite assemblies:


I include some xml embedded in each plugin assembly so that the
application knows what classes it can create, the following is a
simplification of the loading code (this stuff is in the application

FileName = "\plugins\plugin1.dll"; // obviously this isn't hard coded
in the app.
_pluginAssembly = Assembly.LoadFile(FileName);

At this point the XML is loaded, part of this is the name of the
resources that your supposed to pass to the constructor of
ResourceManager. For example assuming the plugin has the namespace
application.plugin1 and the file is resource.resx the xml would contain

We then create the ResourceManager:

resName = "application.plugin1.resource";
ResourceManager rm = new ResourceManager(resName, _pluginAssembly);

And ask for a string

CultureInfo ci = new CultureInfo("fr");
String str = rm.GetString("string", ci);

this returns the string that is in plugin assembly (plugin1.dll) rather
than the satellite assembly no mater which culture I ask for. Using
SysInternal's filemon I see the application looking for
\fr\plugin1.resource.dll then \fr\plugin1.resource.exe. Obviously the
same occurs for dialogs, I assume
System.ComponentModel.ComponentResourceManager (used by default be the
IDE when you make a localizable dialog) is using the same rules as

Is there any way of getting resource from a subdirectory of \plugins\
rather then off of the base directory for those plugin resources?



Reply With Quote

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Assemblies and satellite assemblies Matze Microsoft C# .NET 0 18th Jun 2008 01:07 PM
loading the right resources with Satellite Assemblies Nader Microsoft Dot NET 1 15th Mar 2007 03:41 PM
Using resources in satellite assemblies with ASP.NET (semi-newbie) =?Utf-8?B?RFQ=?= Microsoft ASP .NET 1 4th Apr 2005 10:34 PM
Dynamically creating satellite assemblies with embedded resources =?Utf-8?B?Tm90cmUgUG91YmVsbGU=?= Microsoft Dot NET Framework 2 10th Sep 2004 11:28 AM
Resource manager load resources from multiple satellite assemblies? Notre Poubelle Microsoft Dot NET Framework 0 21st Jul 2004 10:42 PM




All times are GMT +1. The time now is 03:39 PM.