How to run Remote Application

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

The Remoting Framework consists of three key components: a Remotable Object that provides the functionality to be accessed remotely, a Listener Application responsible for receiving and processing requests for the remote object, and a Client Application that initiates requests for the remote object. Furthermore, configuration files are essential for both the Listener Application and the Client Application, as they contain the necessary settings and communication information to ensure smooth and reliable interaction within the remoting environment.

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 ...