Activator.GetObject - MarshalByRefObject

In .Net, Activator.GetObject (type type, url string, object data) returns a proxy object for an object. I am assuming the proxy inherits from MarshalByRefObject and can be dispatched via AppDomains. I'm right?

In my application, I create an object in appdomain A and use its appdomain B. The members of the object are proxy objects created with Activator.GetObject (). so when I am in AppDomain B I have a transparent proxy for an object created in appdomain A. When I try to make a method call on proxy objects I run into errors.

For example, I am creating a Connection object in application domain B. I have a transparent proxy for a Connection object in application domain A. I am throwing an error when I try to make such a call from AppDomain A. ConnectionObject. SecurityProxy.GetSecurityAccount (). the problem seems to be that when i try to make a call like above it tries to re-create the SecurityProxy in AppDomain A instead of forwarding the call to AppDomain B. The security proxy was already created in AppDomain B when the connection object was created.

Could you help me figure out what I am doing wrong?

Best regards, Anil.

+1


source to share


1 answer


Assuming SecurityProxy is a property on ConnectionObject ...

- ConnectionObject A. B, , A.

- . : get_X set_X, , .



, "ConnectionObject.SecurityProxy", , SecurityProxy .

: SecurityProxy ConnectionObject ConnectionObject , / , , .

+1









All Articles