A Simple Introduction to .NET Remoting

Introduction

.NET remoting allows the development of distriubuted applications. It allows applications to use objects contained in other processes. These processes can reside on the same local computer or any remote computer that is reachable via a network (including the Internet).

We wil quickly look at the basics on how to set up a simple .NET remoting system. The system will comprise of:

  • A remotable object (Abstract class and implementation)
  • A Host console application which will sit and listen for object requests
  • A Client console applicaiton that will make requests for the remotable object
Note: The host/client apps can be windows service's, asp.net apps, console apps or windows forms apps etc.

Remotable Type

To enable our object to be remotable and hense accessible from other application domains, we have to inherit from System.MarshalByRefObject. Create a new class library project called RemotableType (the assembly should be called RemotableType.dll). Now, add the class belown to the project.

using System;
public class RemotableType : MarshalByRefObject{
  public string RemotableMethod()
  {
    return "Hello Word";
  }
}

You might also like...

Comments

About the author

Lee Gunn - .NET C# Scotland United Kingdom

Lee Gunn is a freelance Microsoft Certified Developer based in Glasgow, Scotland. Specialising in quality driven Internet solutions, largely built around Microsoft’s .NET platform.

Skills ...

Interested in writing for us? Find out more.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“In theory, theory and practice are the same. In practice, they're not.”