Important alert: (current site time 7/15/2013 8:37:15 AM EDT)
 

winzip icon

_.NET Remoting and Remotable Objects

Email
Submitted on: 5/6/2002 7:42:01 PM
By: Shane Krueger  
Level: Intermediate
User Rating: By 9 Users
Compatibility: VB.NET
Views: 22836
author picture
 
     This code shows how to create remote objects in VB.net. This includes Client-Activated objects, Server-Activated objects, remotable objects, serializable objects, and marshaling objects with the Marshal method. Comments are included in the source code to make it easy to understand.

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

5/14/2002 12:08:53 PMDiovani

Can u explain it better how does it work?
(If this comment was disrespectful, please report it.)

 
6/27/2002 2:00:57 AMbrett robson

I don't believe this example actually works. If you don't send a copy of the RemotingObjects.dll with the client executable it won't run. This defeats the entire purpose of having remote procedures ie you still have to have the correct dll installed on the client side for it to work.

(If this comment was disrespectful, please report it.)

 
6/27/2002 12:48:37 PMShane Krueger

Brett, you are correct in that the RemotingObjects.dll file is needed by the client. This is because the client needs the definitions of all the classes exposed by the server application. In this example however, all of the code IS executed on correct PCs. If you do want to totally separate the server-side code from the client, you would need to create a dll containing only interfaces, which are then implemented inside the server executable. In this way, the server can be updated without affecting the clients (but there are disadvantages). The book 'Advanced .NET Remoting' by Ingo Rammer is great and deals with all these topics. Thanks
(If this comment was disrespectful, please report it.)

 
11/18/2002 5:48:04 PM

When I try and run the project I get an error that says
(If this comment was disrespectful, please report it.)

 
11/18/2002 5:50:32 PM

What up with this code?

When I click on the run button I get an error "A project with an output type of class library cannot be started directly." ect

Why are there no instructions on how to get this baby to run?
(If this comment was disrespectful, please report it.)

 
11/18/2002 6:06:14 PM

You need better instructions for this example to be useful. I couldn't get it to work... an error showing.

I did find a good example here though for anyone that needs something better to go by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvssamp/html/vb cs_TCPRemoting.asp

(If this comment was disrespectful, please report it.)

 
3/2/2003 1:27:25 PMEyeSight_ES

this is great code!!!!!! you guys, remoting is a very! completelcated process I suggests reading there articals on it first(there long)so you know the vocab then look this code again. Thanks very muchyou gave me many hints for ClientActive stuff. thanks again!!!
(If this comment was disrespectful, please report it.)

 
3/2/2003 1:28:54 PMEyeSight_ES

you need to modifiy the solutions properties for mulit starting projects. turn the library off and the server and client on to start that should fix your problem.
(If this comment was disrespectful, please report it.)

 
4/29/2003 7:36:03 PM

Anyone have any recommended online reading on remoting to get the remoting noob up to speed?
(If this comment was disrespectful, please report it.)

 
6/22/2005 9:42:13 AM

I AM 3rd mca so please send any project title and powerful source code to me.



i know your .net so choose .net to help as well as providing the project.I hope you. thank you.

(If this comment was disrespectful, please report it.)

 
12/6/2006 8:04:03 PMpaul

A good example of remoting, works well.
(If this comment was disrespectful, please report it.)

 
11/26/2007 10:25:55 AMJerrame_Hertz

Works great once the projects properties are set to Multiple startup projects and the action for the Client and Server are set to start, leave RemotingObjects action set to None.
****
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.