How to run Remote Application

The .NET Remoting is one of several ways to establish communication between application domains using the .NET Framework.

The main three components of a Remoting Framework are a Remotable Object , Listener Application for listening requests for remote object and a Client Application makes requests for remote object. Additionally you need Configuration files for your Listener Application and Client Application .

How to compiling the C# source code files ?

Create a new folder SRC in c:\ and put the three C# source code files in that folder.

The files are :

1. C# Remotable Object

2. C# Remote Listener Application - (listening requests for Remote Object)

3. C# Remote Client Application - (makes requests for Remote Object)

Add the two configuration files in the same folder (c:\src).

1. download TimeListener.exe.config

2. download Client.exe.config

Now total of 5 files in your c:\src folder.

Compile each C# class files using the command-line tools separately that ship with the Visual Studio SDK .

csc /t:library RemoteTime.cs csc /r:RemoteTime.dll TimeListener.cs csc /r:RemoteTime.dll Client.cs

Note: You have to provide the physical path of each source files when you compile the source code , for example : if the source code files are in the folder c:\SRC , you have to give path like.

csc /t:library c:\src\RemoteTime.cs csc /r:c:\src\RemoteTime.dll c:\src\TimeListener.vb csc /r:c:\src\RemoteTime.dll c:\src\Client.cs

After you complied the C# source code files, you will get additional three files in the c:\src folder.

They are :

  1. RemoteTime.dll
  2. TimeListener.exe
  3. Client.exe

Now total of 8 files in your c:\src folder.

How to run the Remoting Application ?

Create two new folders and give the name like Server and Client respectively in c:\src folder.

Copy RemoteTime.dll , TimeListener.exe and TimeListener.exe.config to the c:\src\server folder.

Copy RemoteTime.dll , Client.exe and Client.exe.config to the c:\src\client folder.

Open a command prompt on Server folder and type TimeListener.

c:\src\server TimeListener

Then you will get a screen showing "Listening for requests from the Client. Press Enter to exit..."

Open a command prompt on Client folder and type Client.

c:\src\client Client

Then you will get the current time from Remote Object.

Now you have done your first .Net Remoting C# Project successfully . Try to explore more on Remoting ...