Questions tagged [marshalbyrefobject]

MarshalByRefObject Class enables access to objects across application domain boundaries in applications that support remoting.

MarshalByRefObject is the base class for objects that communicate across application domain boundaries by exchanging messages using a proxy. Objects that do not inherit from MarshalByRefObject are implicitly marshal by value. When a remote application references a marshal by value object, a copy of the object is passed across application domain boundaries.

MarshalByRefObject objects are accessed directly within the boundaries of the local application domain. The first time an application in a remote application domain accesses a MarshalByRefObject, a proxy is passed to the remote application. Subsequent calls on the proxy are marshaled back to the object residing in the local application domain.

http://msdn.microsoft.com/en-us/library/system.marshalbyrefobject.aspx

76 questions
2
votes
2 answers

.NET remoting threading model

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…
Mr. Lame
  • 1,247
  • 1
  • 17
  • 27
2
votes
0 answers

.NET remoting - nested MarshalByRefObject

I am using the deprecated .NET remoting for purposes that otherwise are not possible to accomplish by WCF. I have a situation in which I use a MarshalByRefObject but one that has nested MarshalByRefObjects that are not exposed as properties but used…
okipol
  • 1,197
  • 3
  • 11
  • 27
2
votes
0 answers

SerializationException: Invalid binary format when accessing a MarshalByRefObject

I am trying to send constantly a jagged array of floats to a Unity app from another C# application. I got a C# dll that uses a MarshalByRefObject and opens an Ipc channel for a simple test server app and a simple test client app. Both apps are able…
2
votes
0 answers

How to prevent memory leak in MarshalByRefObject and AppDomain?

I am trying to compile some code during run time to allow some scripting features in my app, however I wanted to run the script in a sandbox just in case somebody tries to do something naughty. The trouble is - after all is done and I have my…
2
votes
0 answers

Running plugin in a different AppDomain C#

I'm having difficulties trying to run a .dll in a new AppDomain. My object is always of type System.MarshalByRefObject, so I cannot get the methods from the plugin. What I have right now, is a plugin, that implements an interface and extending a…
Tomáš Ptáček
  • 53
  • 1
  • 1
  • 6
2
votes
3 answers

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…
netseng
  • 2,226
  • 6
  • 24
  • 28
2
votes
0 answers

Why am I getting a marshal_by_reference warning

Here is a simplified version of my code: public partial class Master : Form { public DateTime TradingPausedDT; } public class Other { public Master masterForm; public void myFunc() { string fromDateTxt = …
ManInMoon
  • 6,795
  • 15
  • 70
  • 133
2
votes
1 answer

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…
user301460
2
votes
1 answer

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…
skb
  • 30,624
  • 33
  • 94
  • 146
2
votes
0 answers

FileNotFoundException while subscribing to event in MarshalByRefObject

I have application wich uses AppDomains. From main application A (it doesn't have assembly with B loaded) i create some form B, then give an object to that form. Then i'm trying to do like this someObject.eventName += method, NotFoundException…
2
votes
1 answer

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…
jxelam
  • 23
  • 1
  • 4
1
vote
1 answer

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…
aoven
  • 2,248
  • 2
  • 25
  • 36
1
vote
1 answer

Calling methods and getting values in the main appdomain from a secondary domain

I am implementing a module system for my C# IRC Bot. The modules are .dll assemblies which are stored in a subdirectory, "modules", and they are used to add functionality to the bot, such as adding extra commands on IRC. These modules are designed…
Scott
  • 999
  • 7
  • 13
1
vote
1 answer

MarshalByRefObject with iterator method (IEnumerable) not working

I'm trying to make an application that can dynamically load and unload an after-market assembly and create an object of a type defined in that assembly, but I'm running into problems when the object has an iterator method. Stay with me -- the…
Wyck
  • 10,311
  • 6
  • 39
  • 60
1
vote
0 answers

C# How to pass Linq in an interface - MarshalByRefObject

This is a follow up question from here but is of totally different nature. The reason i mention it is because I wanted to provide premise. Basically I'll have a few Datatables (or serialize classes) that will contain over a million rows and will be…
JL1
  • 309
  • 2
  • 18