Sdílet prostřednictvím


<service> Element

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).

Contains objects the application exposes to other application domains or contexts. This element may occur in an application configuration file, machine configuration file.

Schema Hierarchy

<configuration>
  <system.runtime.remoting> Element
    <application> Element
      <service> Element

Syntax

<service>
   <wellknown/>
   <activated/>
</service>

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes

None.

Child Elements

Element Description

<wellknown>

Contains information about server-activated (well-known) objects the application exposes. Can occur one or more times in the <service> element.

<activated>

Contains information about client-activated objects the application exposes. Can occur one or more times in the <service> element.

Parent Elements

Element Description

application

Contains information about remote objects the application consumes and exposes.

configuration

The root element in every configuration file used by the common language runtime and .NET Framework applications.

system.runtime.remoting

Contains information about remote objects and channels.

Example

The following configuration file declares a server-activated (well-known) type, the object URI at which it is to be found, and the WellKnownObjectMode that controls activation of instances.

<configuration>
   <system.runtime.remoting>
      <application>
         <service>
            <wellknown 
               type="ServerActivatedType, RemoteAssembly" 
               objectUri="ServerType.rem" 
               mode="Singleton" 
            />
         </service>
      </application>
   </system.runtime.remoting>
</configuration>

See Also

Reference

Remoting Settings Schema

Concepts

Activation of Remote Objects
Server Activation
Client Activation