Knowledge Base Article

I cannot find Activator.GetObject() at the device side, how can I make a call to my remoting object residing on desktop/server without it?
Article ID: 1012; Product Group: Friquently Asked Questions; Modified On: 6/8/2009 8:17:38 AM

Description:
I cannot find Activator.GetObject() at the device side, how can I make a call to my remoting object residing on desktop/server without it?

Solution / Answer:

The .NET Compact Framework is a slimmed down version of the .NET Full Framework made to run on embedded devices such as PDAs and smart phones. To take into account the resource limitations of these devices, a dedicated execution environment was crafted and some classes and methods of the standard .NET class library were removed. .NET Remoting was among those removed namespaces.

CF.Remoting product fills that gap by providing missing remoting classes and includes remoting proxy generator tool called rpgen.exe which can be found in \bin directory after you installed our product. Rpgen.exe generates client proxies that run against the full .NET framework exposed remoting objects. Rpgen.exe takes an existing interface assembly, extracts interfaces and generates client proxy source code (in C# and/or VB .NET) that implements those shared interfaces and allows you to make remote calls as if you have Activator.GetObject() on the full .NET framework.

Here is an example of generated proxy for an interface (full source code for shared interface assembly, client and server can be found in \Remoting\Examples\CS(VB)\CallContext\ directory):

Instead of making calls to Activator.GetObject() you create an instance of generated client to make calls to/obtain properties of remote object.