Fog Creek Software
Discussion Board

Welcome! and rules

Joel on Software

.NET Remoting question

Hi guys,

I've got the following beginner question. In a client/server .NET remoting app, everything works fine as long as I call server functions that just return data or do whatever else processing on the server side. However, as soon as I try to register with the server a reference to a client side object (in order to get notified when some kind of server event happens) I get the message ""Because of security restrictions, the type System.Runtime.Remoting.ObjRef cannot be accessed." (Btw, the client object is evidently derived from MarshallByRefObject). What am I doing wrong and how can I get around it?

Friday, February 7, 2003

Probably, I didn't understand your question, but why not you use events on server component?

Remoting fully supports event-driven programming and callback functions using synchronous and asynchronous delegates.

Mikhail Andronov
Monday, February 10, 2003

You can see an example on using events in remoting here:

Mikhail Andronov
Monday, February 10, 2003

Thanks Mikhail for your answers. However, using the event/delegate mechanism from .NET raises the same problem (since, basically it's the same thing like I was doing). The problem is with default security level that doesn't allow one client to register code (callbacks or types - beyond the most basic ones) with the server. The solution was, in either cases, to raise the security level (using a ...FormatterSinkProvider) of the communication channel.

Sunday, February 16, 2003

*  Recent Topics

*  Fog Creek Home