Remote Object Configuration
This topic is specific to a legacy technology that is retained for backward compatibility with existing applications and is not recommended for new development. Distributed applications should now be developed using the Windows Communication Foundation (WCF).
Developers publishing or consuming remotable objects are responsible for configuration of the .NET remoting system so that applications using .NET remoting work correctly. You can do this programmatically, or using the application configuration file or the machine configuration file. Administrators can then use the .NET Framework Configuration tool to point remoting clients at different endpoints or to modify the lifetime of client-activated (<activated>) or server-activated (<wellknown>) objects where necessary.
You register your remotable classes by placing them inside the <application> element, which is a child of the <system.runtime.remoting> element. Objects that an application accesses are grouped by remote application under the <client> section within the <application> element. Objects that an application exposes are declared within a <service> section within the <application> node. If you are not hosting your remote types in Internet Information Services (IIS), you can specify a name attribute for your application that then becomes part of your activation URL, but it is not required in any scenario. For more information about hosting in IIS, see Hosting Remote Objects in Internet Information Services (IIS).
In addition, .NET remoting does not automatically pick up any remoting configuration values in the application configuration file. To configure remoting using a configuration file, you must call RemotingConfiguration.Configure. The only case in which the host application domain automatically loads the remoting configuration file is when your remotable type is hosted in IIS. In this case, .NET remoting automatically picks up only the service settings from the Web.config file. Client settings are ignored until the configuration file is again loaded with a direct call to the RemotingConfiguration.Configure method.
The following schema shows the structure of the elements that you can use to configure an application to use .NET remoting.
To use the remoting settings, you must call RemotingConfiguration.Configure on the application configuration file. Note that the common language runtime automatically loads the machine configuration file before it loads the application configuration file. Do not call RemotingConfiguration.Configure on the machine configuration file. Doing so can cause exceptions when some objects that are already in memory are loaded again.
You specify a default lifetime for all client-activated objects and server-activated Singleton objects in an application using the <lifetime> element.
For more information about programmatic configuration and lifetime concepts, see Lifetime Leases.
Instance Elements and Template Elements
There are two types of elements related to building channels: template elements and instance elements. Template elements are used to declare a channel, a server or client channel sink provider, or a server or channel sink formatter for use anywhere else in the same application by referencing the ID attribute of the template element.
|Whenever you use the type attribute in a template element to create a default configuration that uses a system-implemented type, such as a BinaryFormatter or an HttpChannel, you must specify complete type information, including version, culture, and strong-naming information. This information can be obtained from the machine.config file, or by using the global assembly cache utility Gacutil.exe. This is not necessary if the type is defined in an assembly that is not in the global assembly cache but is locatable, or if you are referencing the type in an instance element, where you can use the ref attribute.|
TasksHow to: Configure the Lifetime of a Client-Activated or Server-Activated Remote Object
How to: Configure Channels
ConceptsConfiguration of Remote Applications
Other ResourcesRegistering Remote Objects Using Configuration Files
.NET Framework Remoting Overview