Groups | Blog | Home
all groups > dotnet remoting > january 2004 >

dotnet remoting : Reading a Configuration File


Chris B.
1/30/2004 1:43:04 PM
It is possible to read the <system.runtime.remoting> section of a
configuration file similarly to the way that you can read a user-defined
section using ConfigurationSettings.GetConfig()? I'm finding that
attempting to load and read the <system.runtime.remoting> section as if it
were a user-defined section results in a ConfigurationException being thrown
that says that the section is already defined.

My scenario is a Windows Service that is using
RemotingConfiguration.Configure() to host remote objects.

Thanks,
Chris

Chris B.
1/30/2004 2:41:09 PM
FWIW, I found and used:

XmlDocument xmlDocument = new XmlDocument();


xmlDocument.Load(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile)
;

XmlNode xmlNode =
xmlDocument.SelectSingleNode("configuration/system.runtime.remoting");

ConfigurationItem configurationItem = new ConfigurationItem(xmlNode);

with a pre-existing ConfigurationItem object that I have already implemented
which provides access to all of the data contained with an XmlNode of a
configuration file.

Chris



[quoted text, click to view]

It is possible to read the <system.runtime.remoting> section of a
configuration file similarly to the way that you can read a user-defined
section using ConfigurationSettings.GetConfig()? I'm finding that
attempting to load and read the <system.runtime.remoting> section as if it
were a user-defined section results in a ConfigurationException being thrown
that says that the section is already defined.

My scenario is a Windows Service that is using
RemotingConfiguration.Configure() to host remote objects.

Thanks,
Chris


AddThis Social Bookmark Button