Cook Computing

RemotingException and Missing Channel Sinks

September 4, 2003 Written by Charles Cook

The .NET exception type RemotingException can be thrown for various reasons, including two situations in which it is thrown with the following message:

An unhandled exception of type 'System.Runtime.Remoting.RemotingException' occurred in mscorlib.dll

Additional information: This remoting proxy has no channel sink which means either the server has no registered server channels that are listening, or this application has no suitable client channel to talk to the server.

One case is where the client passes an object reference in a call to the server and the server makes a call back to the object on the client. The exception is thrown because there is no remoting channel back to the client through which the server can make the call. Solution: register a channel on the client via a call to ChannelServices.RegisterChannel.

The second case is more obscure. This occurs where the client makes a call to the server, the server returns an object reference, and the client then makes a call on the referenced object on the server. If the referenced object is in a secondary AppDomain on the server the above exception may be thrown. If the the problem occurs it is because channel registration only applies to the AppDomain in which RegisterChannel is called and no channel has been registered in the secondary AppDomain. The object reference returned to the client points to the object in the secondary AppDomain, not to its proxy in the primary AppDomain, and so there is no channel between the client and the secondary AppDomain across which the call can pass. Solution: register a channel in the secondary AppDomain in which the referenced object exists.