Click here to Skip to main content
14,365,424 members

.NET Remoting: Passing through the obstacles path from version 1.0 to 1.1

Rate this:
4.73 (68 votes)
Please Sign up or sign in to vote.
4.73 (68 votes)
31 Mar 2004
Houston, we have a problem. One small step for mankind, one Giant irritation for developers.


The following article's aim is to help those of you who want to use .NET Remoting on Framework 1.1*. This article will not teach you Remoting, mainly because I am not an expert on that field. Furthermore, my CodeProject colleagues published some useful and nice to read articles on that issue (see links below). The attached projects were kept simple as possible to allow you to overcome the changes presented by Framework 1.1*. It handles the maladies of security exception, serialization and delegates issues.


Recently, I have faced the challenge of exposing objects via .NET Remoting. Like the most of you, I have started with the MSDN, and of course CodeProject, but all the examples were suited for Framework 1.0 only. Attempts to run 1.0 project on a 1.1 Framework ends with lots of exceptions.

  • Type System.DelegateSerializationHolder and the types derived from it (such as System.DelegateSerializationHolder) are not permitted to be deserialized at this security level.
  • Because of security restrictions, the type System.Runtime.Remoting.ObjRef cannot be accessed.
  • 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.

The web is full of developers' complaints on the very same problems but I have not found a simple, corrective and comprehensive example. So there you have it!.

Code snippets

Activate through Config files

Server side configuration

    <application name="ServerAssembly" >
          <!-- type: is the full type name 
(type the class that inherit from MBR,assembly) of the 
          <!-- objectUri - alias -->
          <!-- Server tells remoting Here's a type 
Here's how and when to instantiate the type
Here's the name (end point) a client will use to contact the type
        <wellknown mode="Singleton" 

            type="SharedAssembly.SharedObj, SharedAssembly" 

objectUri="ParachuteExample" />
            <channel ref="tcp" port="6123">    
                    <formatter ref="binary" typeFilterLevel="Full" />

Server side code

RemotingConfiguration.Configure ("ServerAssembly.exe.config");

Client side configuration

            type="SharedAssembly.SharedObj, SharedAssembly"
 <channel ref="tcp" port="0">
   <formatter ref="binary" />
   <formatter ref="binary" typeFilterLevel="Full" />


Client side code

RemotingConfiguration.Configure ("ClientAssembly.exe.config");
SharedObj remObject = new SharedObj();

Activate through code

Server side

BinaryClientFormatterSinkProvider clientProvider = null;
BinaryServerFormatterSinkProvider serverProvider =
   new BinaryServerFormatterSinkProvider();
serverProvider.TypeFilterLevel =


IDictionary props = new Hashtable();
props["port"] = 6123;
props["typeFilterLevel"] = TypeFilterLevel.Full;
TcpChannel chan = new TcpChannel(



Client Side

BinaryClientFormatterSinkProvider clientProvider =
   new BinaryClientFormatterSinkProvider();
BinaryServerFormatterSinkProvider serverProvider =
   new BinaryServerFormatterSinkProvider();
serverProvider.TypeFilterLevel =


IDictionary props = new Hashtable();
props["port"] = 0;
string s = System.Guid.NewGuid().ToString();
props["name"] = s;
props["typeFilterLevel"] = TypeFilterLevel.Full;
TcpChannel chan = new TcpChannel(


Type typeofRI = typeof(IParachute);
IParachute remObject = (IParachute)Activator.GetObject(    typeofRI,

Using the code

Since some of you like configuration files while others like to connect and create the well known object via code, I have included two projects accordingly. Both projects, and, include the same assemblies as follows:

  • ClientAssembly
  • ServerAssembly
  • SharedAssembly


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

No Biography provided

Comments and Discussions

GeneralMy vote of 2 Pin
ngoj29-Dec-09 15:22
memberngoj29-Dec-09 15:22 
QuestionBug Remoting by TCP channel in Vista Pin
Zapfchen7-Jul-09 4:57
memberZapfchen7-Jul-09 4:57 
AnswerRe: Bug Remoting by TCP channel in Vista Pin
Zapfchen9-Jul-09 3:36
memberZapfchen9-Jul-09 3:36 
GeneralServer Raise Event Pin
tbman16-Jan-09 15:54
membertbman16-Jan-09 15:54 
GeneralHi Thanks! HttpChannel is working now! Pin
Jayson Ragasa21-Oct-08 20:02
memberJayson Ragasa21-Oct-08 20:02 
GeneralSame problem in HttpChannel Pin
Jayson Ragasa21-Oct-08 19:56
memberJayson Ragasa21-Oct-08 19:56 
GeneralExcellent article, got exactly what I wanted Pin
ebranson196912-May-08 9:43
memberebranson196912-May-08 9:43 
GeneralThanks a lot! Pin
sidkud24-Dec-07 13:53
membersidkud24-Dec-07 13:53 
GeneralWMI versus .Net Remoting Pin
puromtec19-Aug-07 7:36
memberpuromtec19-Aug-07 7:36 
GeneralRe: WMI versus .Net Remoting Pin
Cohen Shwartz Oren13-Aug-07 1:25
memberCohen Shwartz Oren13-Aug-07 1:25 
GeneralRe: WMI versus .Net Remoting [modified] Pin
puromtec114-Aug-07 5:42
memberpuromtec114-Aug-07 5:42 
GeneralNicely Done Pin
Christopher G. Lasater23-May-07 9:30
memberChristopher G. Lasater23-May-07 9:30 
GeneralRe: Nicely Done Pin
Cohen Shwartz Oren23-May-07 10:30
memberCohen Shwartz Oren23-May-07 10:30 
GeneralExample fails using HttpChannel Pin
rcarsten14-Nov-06 23:13
memberrcarsten14-Nov-06 23:13 
GeneralRe: Example fails using HttpChannel Pin
Jayson Ragasa21-Oct-08 20:03
memberJayson Ragasa21-Oct-08 20:03 
QuestionRetrieving events in VBA Pin
Joao Eduardo Grossi24-Oct-06 6:46
memberJoao Eduardo Grossi24-Oct-06 6:46 
GeneralThanks a lot Pin
Nehal Kanani20-Jan-06 1:05
memberNehal Kanani20-Jan-06 1:05 
GeneralRe: Thanks a lot Pin
Cohen Shwartz Oren12-May-07 7:14
memberCohen Shwartz Oren12-May-07 7:14 
GeneralEvents Pin
Hector Caban2-Apr-05 1:27
memberHector Caban2-Apr-05 1:27 
GeneralRe: Events Pin
Cohen Shwartz Oren12-May-07 7:13
memberCohen Shwartz Oren12-May-07 7:13 
GeneralRe: Events Pin
Chris Zubriski16-Sep-08 9:03
memberChris Zubriski16-Sep-08 9:03 
Generalnew cool stuff Pin
Alex Sivokho4-Feb-05 0:23
memberAlex Sivokho4-Feb-05 0:23 
GeneralRe: new cool stuff Pin
Cohen Shwartz Oren17-Mar-05 3:20
memberCohen Shwartz Oren17-Mar-05 3:20 
GeneralRe: new cool stuff Pin
ajn999917-Mar-05 19:40
memberajn999917-Mar-05 19:40 
GeneralSome Remoting Exceptions and how to deal with them Pin
Cohen Shwartz Oren18-Oct-04 1:08
memberCohen Shwartz Oren18-Oct-04 1:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Posted 30 Mar 2004


40 bookmarked