Nastavení XML-RPC.NET programově bez nutnosti existence konfiguračního souboru

Jelikož se mi v aktuálním projektu nehodila existence konfiguračního souboru aplikace (app.config) pro zajištění konfigurace XML RPC serveru ve vlastní assembly, potřeboval jsem stejné parametry nastavit programově.

Nakonec jsem narazil na odpověď:

ListDictionary prop = new ListDictionary();

prop.Add("port", 1971);

HttpChannel channel = new HttpChannel( prop, null, new XmlRpcServerFormatterSinkProvider(null, null));

ChannelServices.RegisterChannel(channel);

RemotingConfiguration.RegisterWellKnownServiceType( typeof(Server), "myApp/anURI", WellKnownObjectMode.Singleton);