marshalbyrefobject

Logging using policy injection application block

Hi All I want to ask, how to use policy injection application block to log methods entry and exit in these cases : Case1 : in case of logging events handlers of a web form controls, you know the class let's say _Default must be inherited from class System.Web.UI.Page , so we can't inherit our class from MarshalByRefObject class so log...

How to solve "Must be MarshalByRefObject" in a good but multiple-inheritance amputated language like C#?

How to solve "Must be MarshalByRefObject" in a good but multiple-inheritance amputated language like C#? The problem is very simple, in several cases you just have to inherit from this class (infrastructure requirements). It does not matter here really, which cases. So, what do you do if you've already inherited from some other class (y...

Workaround .net application domain only passing objects by value

Hi *, I am developing an .net application which heavely depends on plugins. The application itself contains an connection to a remote server. Recently I digged into Application domains and see them as the ideal solution for isolating the plugin code from the rest of the application. However there is one big disadvantage which makes m...

.NET remoting threading model

Hi, I would like to know how threads are handled on the server side using MarshalByRef objects. Given my remoted MarshalByRef class: public class MyRemotedClass : MarshalByRef { public int MyInt; public string MyString; } Client code (single threaded): MyRemotedClass m = GetSomehowMyRemotedClass(); m.MyInt = 5; // Write operat...

Serializable Objects with MarshalByRefObject Fields

Alright, I'm not sure if this question has been asked before so if it has then flame away. Lets say we have two classes like this [Serializable] public class ClassA { private string _name; private ClassB _data; } public class ClassB : MarshalByRefObject { public string GetAppDomainName() { return AppDomain.Curren...

Generic container for exposing POCO instances to other AppDomains - how does it work?

I'm intrigued by this answer from another SO thread, and I was hoping someone can help me shine some light on the concept. Say I have a primary AppDomain and a bunch of child AppDomains, that are created and initialized by the primary AppDomain. In pseudo code: Primary AppDomain: class Parent { public void InitChildren(IList<Child...

Mono, Serializable Objects with MarshalByRefObject

I'm attempting to port a C# application to .NET (client server), and am running into issues with serialization. The Linux client serializes and object, but the Windows server is unable to deserialize it, giving the error: System.Runtime.Serialization.SerializationException Field "MarshalByRefObject+__identity" not found in class Deser...

Passing data across appdomains with MarshalByRefObject.

I'm having a little trouble passing some data between two .NET appdomains and I'm hoping someone on here can help me. Basically what I have is a main application (Main) which loads assembly A and B into it's main domain, then when I run a plugin(C) Main calls a create domain method on B which creates a new domain and loads C and a insta...

Speeding up cross-AppDomain communication

I am trying to execute some logic on multiple AppDomains in parallel. I am doing this because I am working with legacy code which is "un-changeable" and I want to improve performance by parallelizing some things. The problem is that if I run multiple instances within 1 AppDomain they all rely on some static data structures and interfer...

Creative use of MarshalByRefObject

I've been banging my head trying to figure some things out. So, I'm looking for advice and research material (via links). Here's the scenario: We have a library (say, CommonLib) that contains resources needed by several other applications (say, AppA, AppB, AppC, and so on...). Now, the way this is currently working is AppA instances, ch...

Using an abstract class as the contract in plugin framework...

Can an abstract class be used as the contract object between a 'Host' and a 'plugin'? The idea is that the plugin inherits the contract (we call it an adapter). We are also understanding that all participants in the framework must inherit MarshalByRefObject (MBRO). So, this is what we were thinking - Host: class Host : MarshalByRefObj...

Why can't pass Marshaled interface as integer(or pointer)

I passed ref of interface from Visio Add-ins to MyCOMServer (http://stackoverflow.com/questions/2455183/interface-marshalling-in-delphi).I have to pass interface as pointer in internals method of MyCOMServer. I try to pass interface to internal method as pointer of interface, but after back cast when i try call method of interface I ge...

How can I find out if an instance is a MarshalByRef proxy?

I know there's a way, I know I've done it (a long time) before, but I can't remember or find out how to do it!!! var otherDomain = AppDomain.Create("Lol my memory sucks"); var myRemotableType = typeof(MyTypeThatExtendsMBRO); var proxy = otherDomain .CreateInstanceAndUnwrap( type.Assembly.FullName, type.FullName); // how...

Interaction between multiple AppDomain. Problems with the destruction of singleton-objects.

The problem is the following. There is an application that is at work creating additional AppDomain's and loads there assembly (custom user scripts). In the main application, there are some objects, references to which to transfer ownership to those created AppDomain's. Objects themselves are the MarshalByRefObject, and they are disabl...

How do I pass references as method parameters across AppDomains?

I have been trying to get the following code to work(everything is defined in the same assembly) : namespace SomeApp{ public class A : MarshalByRefObject { public byte[] GetSomeData() { // } } public class B : MarshalByRefObject { private A remoteObj; public void SetA(A remoteObj) { this.remoteObj = remoteObj; } ...

Garbage collecting objects crossing AppDomain boundary

Hi, When you pass an object that inherits from MarshalByRefObject to a different AppDomain, won't GC.Collect() induced by the AppDomain that created it collect the object, provided that the object is not rooted in either AppDomain by the time GC.Collect() called? [When I say not rooted I mean no developer written code access it anymore...