Article ID: 300951 - Last Review: August 28, 2007 - Revision: 2.2 How to create a remote server by using Visual Basic .NETThis article was previously published under Q300951 On This PageSUMMARY This article illustrates how to create a simple, remote
server that another application can access. The application that accesses this
server can be located on the same computer, on a different computer, or on a
different network. The remote server is broken into two parts: the server
object and the server application. The server object is the object with which
the client communicates, and the server application is used to register the
server object with the Remoting runtime. RequirementsThe following list outlines the recommended hardware, software, network infrastructure, and service packs that you need:
Create a remote server objectThe first step to creating the server application is to create the server object. The server object is what the client application instantiates and communicates with on the server computer. The client application does this through a proxy object that is created on the client. In this sample, the server object resides in a Class Library (DLL) and is called myRemoteClass.
Create a remote server applicationAfter you create the server object with which the client will communicate, you must register this object with the Remoting framework. When you register the object, you must also start the server and have the server listen on a port for clients to connect to that port. To do this, you need a project type that creates an executable. The server object is included in a separate project so that you can easily reference the server object from the client project. If you include the server object in this project, you cannot reference it because references can only be set to DLL files.
Test the server objectTo create a client application that communicates with the server object that you just created, see the following Microsoft Knowledge Base article:300943
(http://support.microsoft.com/kb/300943/
)
How to create client access to remote server by using Visual Basic .NET
REFERENCES
For more information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
301116
(http://support.microsoft.com/kb/301116/
)
How to marshal an object to a remote server by value by using Visual Basic .NET
301112
(http://support.microsoft.com/kb/301112/
)
How to marshal an object to a remote server by reference by using Visual Basic .NET
For more information about the TcpChannel class, see the following .NET Framework Class Library Web site: http://msdn2.microsoft.com/en-us/library/system.runtime.remoting.channels.tcp.tcpchannel(vs.71).aspx
(http://msdn2.microsoft.com/en-us/library/system.runtime.remoting.channels.tcp.tcpchannel(vs.71).aspx)
For more information about the RegisterWellKnownServiceType method, see the following .NET Framework Class Library Web site: http://msdn2.microsoft.com/en-us/library/system.runtime.remoting.remotingconfiguration.registerwellknownservicetype(vs.71).aspx
(http://msdn2.microsoft.com/en-us/library/system.runtime.remoting.remotingconfiguration.registerwellknownservicetype(vs.71).aspx)
For an overview of .NET Remoting, see the .NET Framework
Developer's Guide documentation. | Article Translations
|
Back to the top
