共用方式為


<application> Element

Contains information about remote objects the application consumes and exposes.

<configuration>
   <system.runtime.remoting>
**      <application>**

<application name="AppName">
   <lifetime/>
   <channels/>
   <service/>
   <client/>
   <soapInterop/>
</application>

Optional Attributes

Attribute Description
name Names the application. You cannot use this attribute when hosting a remote type in Internet Information Services (IIS). In other hosting scenarios, the name becomes a part of the activation URL. For details, see Activation URLs.

Child Elements

Element Description
<lifetime> Contains information about the lifetime of all remotable objects. Can occur once in the <application> element.
<service> Contains objects the application exposes. Can occur one or more times in the <application> element.
<client> Contains objects the application consumes. Can occur one or more times in the <application> element.
<channels> Contains channels that the application uses to communicate with remote objects. Can occur once in the <application> element.
<soapInterop> Contains type mappings used with SOAP. Can occur once in the <application> element.

Example

The following configuration file declares lifetime information for all remote types hosted by a server application domain, declares for publication a server-activated (well-known) remote type, specifies that the default HttpChannel should listen on port 8080, and indicates that the .NET Remoting system should load all specified types (in this case, both the HttpChannel and the ServerActivatedType) when the host application starts.

<configuration>
   <system.runtime.remoting>
      <application>
         <lifetime
            leaseTime="10S"
            sponsorshipTimeout="0S"
            renewOnCallTime="5S"
            leaseManagerPollTime="5S"
         />
         <service>
            <wellknown 
               type="ServerActivatedType, RemoteAssembly" 
               objectUri="ServerType.rem" 
               mode="Singleton" 
            />
         </service>
      <channels>
         <channel port="8080" ref="http"/>
      </channels>
      </application>
      <debug loadTypes="true"/>
   </system.runtime.remoting>
</configuration>

Requirements

Configuration Files: Application configuration file, machine configuration file (Machine.config)

See Also

Remoting Settings Schema | Remote Objects and Channels