Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Remoting / July 2003

Tip: Looking for answers? Try searching our database.

Proxy question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ron Bullman - 26 Jul 2003 18:27 GMT
Hi,

Consider following scenario:
I have a host.exe-assembly (host), functionality.dll-assembyly
(functionality), and a client.dll-assembly (client). Host and client
"imports" statically functionality. (But host doesen't "import" client).
From the host I'm dynamically loading the client to other AppDomain and with
AppDomain.DoCallBack method I can execute code in the dynamically loaded
AppDomain.

And the specific question:
What kind of proxy is needed to enable the client to communicate with the
functionality in the host? And does there exists some (semi)automatic tools
to create such proxy?

Thanks,
Ron
Kumar Gaurav Khanna [.NET MVP] - 27 Jul 2003 02:52 GMT
Hi!

Any communication across AppDomains involves remoting (typically).

Since the client and the host are in different AppDomains, in order to
reference objects across them, you will need to have objects of classes that
are remoteable, deriving them from MarshalByRefObject. This shall result in
case of the a proxy created in the callers AppDomain. And you dont have to
do anything special for this, except for having the class derive from
MarshalByRefObject.

Alternately, tagging them as Serializable, or implementing ISerializable
will make them go across by value instead of reference.

Regards,
Gaurav Khanna
Signature

----------------------------------------------------------------------------
----------
Microsoft MVP - .NET, MCSE Windows 2000/NT4, MCP+I
WinToolZone - Spelunking Microsoft Technologies
http://www.wintoolzone.com/
OpSupport - Spelunking Rotor
http://opsupport.sscli.net/
----------------------------------------------------------------------------
----------

> Hi,
>
[quoted text clipped - 13 lines]
> Thanks,
> Ron
Ron Bullman - 27 Jul 2003 05:01 GMT
Hi Gaurav,

Just deriving from the MarshalByRefObject, will do the trick. Cool!

Ron
> Hi!
>
[quoted text clipped - 42 lines]
> > Thanks,
> > Ron

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.