Hello!
I have a simple client/server plugin based architecture. I place all the
plugins in \plugins sub-directory on both, server and the client. Each DLL
has implemented two interfaces.. on for client side and other for server
side. On the server I dinamically load all the assemblies from that
sub-directory and register the objects that implement IBuddyPluginSer verSide
as SAOs. On the client I do the same for those that implement
IBuddyPluginCli entSide . I also Activate the server side SAO and pass it as
reference to the ClientSide object.
This is my method for registering SAOs on the server:
private void RegisterPlugins ()
{
string dir = "plugins\\" ;
foreach(string file in new FilesEnumerator (dir, "*.dll"))
{
Assembly asm = Assembly.LoadFr om(dir + file);
foreach(Type t in asm.GetTypes())
{
if(MyLib.Tools. ImplementsInter face(t,
typeof(IBuddyPl uginServerSide) ))
{
IBuddyPluginCom mon common =
(IBuddyPluginCo mmon)MyLib.Tool s.InstantiateOb ject(asm,
typeof(IBuddyPl uginCommon));
RemotingConfigu ration.Register WellKnownServic eType(t,
common.GetWellK nownServerName( ),
WellKnownObject Mode.Singleton );
}
}
}
}
All good... but when I make a first call to one of SAOs methods from the
client, I get the "plugin1.dl l" FileNotFound exception on the server. When I
place the dll in server root, it works. So obviously, the server forgets,
that the assembly resides in the sub-directory and on the first call it
wants to find it in root. The server remembers the name of the plugin
though.. but it assumes that it resides in the root. How could I solve this?
And also.. did anyone figure out yet why the server is inaccessible when the
connection to the LAN/WAN drops even if client and server are on the same
machine?
I have the description of the problem/bug here:
http://www.david13.com/cases/DotNet/...Local-Machine/
Thank you very much!!
David