Export (0) Print
Expand All
0 out of 2 rated this helpful - Rate this topic

Programmatic Configuration 

Programmatic configuration is useful in some cases. Although configuration files can be helpful for quick redirection without recompiling your application, you can also directly configure your remote types in the hosting application domain and in the client application domain. The general requirements of configuration apply. The following code example shows a simple programmatic configuration of a listening application domain.

ChannelServices.RegisterChannel(new HttpChannel(1234));
WellKnownServiceTypeEntry WKSTE = new WellKnownServiceTypeEntry(typeof(ServiceClass),"HttpService", WellKnownObjectMode.SingleCall);
RemotingConfiguration.ApplicationName = "HttpService";
RemotingConfiguration.RegisterWellKnownServiceType(WKSTE);

In more complex scenarios, such as programmatically publishing a particular instance of a remote object and then removing that object from publication, this type of configuration becomes a requirement. For more information, see Advanced Remoting and Remoting Example: Dynamic Publication.

See Also

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.