Modular Server .NET

I have tried with this sample:

http://old.wiki.remobjects.com/wiki/Modular_Server_Sample_(.NET)

Do you have any recommendations concerning unloading assembly DLLs ?

There is an example here:

Or something like this:

var f := ‘<path_to_dll>’;
var domain := AppDomain.CreateDomain(System.IO.Path.GetFileName(f));
var reader := new System.IO.StreamReader(f, System.Text.Encoding.GetEncoding(1252), false);
var b := new Byte[reader.BaseStream.Length];
reader.BaseStream.Read(b, 0, System.Convert.ToInt32(reader.BaseStream.Length));
domain.Load(b);
reader.Close();
domains.Add(System.IO.Path.GetFileName(f), domain);

It should then be possible to unload the AppDomain.

Any recommendations? Thanks.

I see this sample:

I guess that would be the recommended way?
Does it also work with RO/DA services inside the assembly?

If I do the following:

var f := ‘filename.dll’;
var domain := AppDomain.CreateDomain(System.IO.Path.GetFileName(f));
var reader := new System.IO.StreamReader(f, System.Text.Encoding.GetEncoding(1252), false);
var b := new Byte[reader.BaseStream.Length];
reader.BaseStream.Read(b, 0, System.Convert.ToInt32(reader.BaseStream.Length));
domain.Load(b);
reader.Close();

The runtime-generated RODL works as expected, it shows the Service Methods from the loaded class library DLL.

However if I run this:

AppDomain.Unload(domain);

The Service Methods are still visible in the generated RODL - can I force the runtime-generated RODL to be regenerated?

Hello

Could you create a small testcase of your server? By default RODL is generated only for the current AppDomain, so I would like to check how exactly did you get RODLes from the loaded assemblies to get merged into the main server’s RODL

Regards

Here you have a test-case.
ROSDK_Load_Assembly.zip (119.7 KB)

Hello

The RODL generator was not designed to be used with multiple AppDomains. It works only with services defined in the main applcation Domain.