Compiling and Running Remote Application in VB.Net

The .NET Remoting framework is a powerful mechanism within the .NET Framework that enables communication between application domains. It provides developers with a versatile option for establishing inter-domain communication and facilitating the exchange of data and functionality.

The Remoting Framework consists of three primary components: the Remotable Object, the Listener Application, and the Client Application. The Remotable Object represents the object that can be accessed remotely and interacts with other application domains. The Listener Application is responsible for listening and handling incoming requests for the remote object, ensuring seamless communication between the domains. On the other hand, the Client Application initiates requests for the remote object and interacts with it as needed.

Compiling the VB.Net source code files

Create a new folder SRC and put the three VB.Net source code files in that folder.

1. RemoteTime.vb

2. TimeListener.vb

3. Client.vb

Add the two configuration files in the same folder

1. TimeListener.exe.config

2. Client.exe.config

Compile these VB.Net class files using the command-line tools that ship with the .NET Framework SDK.

  1. vbc /t:library RemoteTime.vb
  2. vbc /r:RemoteTime.dll TimeListener.vb
  3. vbc /r:RemoteTime.dll Client.vb
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:
vbc /r:c:\SRC\RemoteTime.dll c:\SRC\TimeListener.vb

After you complied the VB.Net source code files, you will get additional three files in the SRC folder. They are :

  1. RemoteTime.dll
  2. TimeListener.exe
  3. Client.exe
To run the application

Create two new folders and give the name like Server and Client respectively.

Copy RemoteTime.dll , TimeListener.exe and TimeListener.exe.config to the Server folder.

Copy RemoteTime.dll , Client.exe and Client.exe.config to the Client folder.

Open a command prompt on Server folder and type 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.

Then you will get the current time from remote Object.

Now you have done your first .Net Remoting VB.Net project successfully . Try to explore more on Remoting ...

Configuration files

In addition to these core components, Configuration files play a crucial role in configuring the Listener Application and the Client Application. These files contain important settings and parameters that govern the behavior and communication aspects of the applications. By utilizing Configuration files, developers can fine-tune the behavior of the Listener Application and the Client Application to suit their specific requirements, ensuring optimal performance and compatibility.

Using the .NET Remoting framework and its key components, developers can establish robust communication channels between application domains. This allows for seamless data exchange, collaboration, and interoperability between different parts of a distributed application. The Remotable Object serves as the central entity that can be accessed remotely, while the Listener Application and the Client Application facilitate the interaction and communication processes.

Conclusion

The .NET Remoting framework provides developers with a powerful toolset for establishing communication between application domains. By utilizing Remotable Objects, Listener Applications, and Client Applications, developers can enable remote access to objects and facilitate data exchange across domains. Additionally, Configuration files offer flexibility and customization options, allowing developers to fine-tune the behavior of their applications. Through the combined utilization of these components, the .NET Remoting framework empowers developers to create distributed applications with seamless communication and collaboration capabilities.