ApplicationName Property
Collapse the table of content
Expand the table of content

RemotingConfiguration.ApplicationName Property

Gets or sets the name of a remoting application.

Namespace: System.Runtime.Remoting
Assembly: mscorlib (in mscorlib.dll)

public static string ApplicationName { get; set; }
/** @property */
public static String get_ApplicationName ()

/** @property */
public static void set_ApplicationName (String value)

public static function get ApplicationName () : String

public static function set ApplicationName (value : String)

Property Value

The name of a remoting application.

Exception typeCondition

SecurityException

At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. This exception is thrown only when setting the property value.

An application name can be set only once, either through the current property or through a configuration file. If an application is running inside a hosted environment, such as Internet Information Services (IIS), this value might have already been set (usually to the virtual directory). The current property will return a null reference (Nothing in Visual Basic) if the application name has not been set.

The following code example demonstrates the use of the ApplicationName property to indicate the name of the remoting application. For the full example code, see examples for the RegisterWellKnownClientType and RegisterWellKnownServiceType methods.

ChannelServices.RegisterChannel(new TcpChannel(8082));

RemotingConfiguration.ApplicationName = "HelloServiceApplication";

RemotingConfiguration.RegisterWellKnownServiceType( typeof(HelloService),
                                                    "MyUri",
                                                    WellKnownObjectMode.SingleCall 
                                                  );

ChannelServices.RegisterChannel(new TcpChannel(8082));

RemotingConfiguration.set_ApplicationName("HelloServiceApplication");

RemotingConfiguration.RegisterWellKnownServiceType
    (HelloService.class.ToType(), "MyUri", 
    WellKnownObjectMode.SingleCall);

The following code example demonstrates how to access an object remoted from a named application.

ChannelServices.RegisterChannel(new TcpChannel());

RemotingConfiguration.RegisterWellKnownClientType(
                                                   typeof(HelloService),
                                                   "tcp://localhost:8082/HelloServiceApplication/MyUri"
                                                 );

HelloService service = new HelloService();

ChannelServices.RegisterChannel(new TcpChannel());

RemotingConfiguration.RegisterWellKnownClientType
    (HelloService.class.ToType(),
    "tcp://localhost:8082/HelloServiceApplication/MyUri");
HelloService service = new HelloService();

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2016 Microsoft