[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

MarshalByValue from other appdomain

news4schuster

9/9/2004 7:28:00 AM

Hello,


I try to write a program in J# that loads and unloads assemblies
dynamically. So far I know, this is only possible by using different
appdomains.
To be able to use the loaded classes and their functions in the main
application domain I used MarshalByRefObject to create an instances of
classes and unwrap them in the destination appDomain.
This works fine and I can also call functions with simple parameters.
Unfortunately I also want to use methods with parameters which contain
for example hashmaps of java.util which is included in vjslib. This
classes are not serializable and therefore can not be transmitted via
proxy to an other appdomain. But this is necessary if we use
MarshalByRefObject because here we don't have a real copy in the
destination appdomain.
In some articles and books I red that Marshalling by value makes real
copies of an object which I can use in an other application domain.
This method would be perfect for my work.
But how can I create an instance of an object in one appdomain and put
a real copy of it (marshal-by-value) in a second appdomain?

Thanks for your help in advance.

Matthias
1 Answer

Ken Kolda

9/9/2004 4:49:00 PM

0

You hit on the way this done -- the class must be serializable to be
marshalled by value across app domains. Instead of using the Java hashmap,
can you use System.Collections.Hashtable, which is serializable?

Ken


"Matthias" <news4schuster@freenet.de> wrote in message
news:7e89c232.0409082327.46dbbca3@posting.google.com...
> Hello,
>
>
> I try to write a program in J# that loads and unloads assemblies
> dynamically. So far I know, this is only possible by using different
> appdomains.
> To be able to use the loaded classes and their functions in the main
> application domain I used MarshalByRefObject to create an instances of
> classes and unwrap them in the destination appDomain.
> This works fine and I can also call functions with simple parameters.
> Unfortunately I also want to use methods with parameters which contain
> for example hashmaps of java.util which is included in vjslib. This
> classes are not serializable and therefore can not be transmitted via
> proxy to an other appdomain. But this is necessary if we use
> MarshalByRefObject because here we don't have a real copy in the
> destination appdomain.
> In some articles and books I red that Marshalling by value makes real
> copies of an object which I can use in an other application domain.
> This method would be perfect for my work.
> But how can I create an instance of an object in one appdomain and put
> a real copy of it (marshal-by-value) in a second appdomain?
>
> Thanks for your help in advance.
>
> Matthias