How can I read the channel port from app.config?

Discussion in 'Microsoft Dot NET Framework' started by Jason Barnett, Apr 23, 2009.

  1. I have created a server application and placed the remoting configuration in
    the app.config file. The server application works great.

    I'm now trying to create a client application that will actually reside in
    the same directory as the server application. I'd like the client
    application to determine its port from the server application's exe file.
    I've tried using XmlDocument to open and navigate to the channel port, but
    LoadXml throws an exception saying "Data at the root level is invalid". I
    don't understand though, since the server application reads it fine.

    I also tried opening the configuration file using ConfigurationManager, but
    it doesn't seem to read any of the sections. There's no error, just no
    information. Besides, I wouldn't know how to navigate to the channel port
    that way, anyway.

    Could someone point me in a useful direction, for getting the port number?
     
    Jason Barnett, Apr 23, 2009
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DPlsn

    Dynamic Properties, App.config, and <AppName>.exe.config

    DPlsn, Mar 5, 2004, in forum: Microsoft Dot NET Framework
    Replies:
    0
    Views:
    528
    DPlsn
    Mar 5, 2004
  2. Guest

    How to reference an external config file in app.config

    Guest, Jun 19, 2006, in forum: Microsoft Dot NET Framework
    Replies:
    4
    Views:
    1,431
    Guest
    Aug 14, 2007
  3. Guest

    app.config and assembly config in My.Config

    Guest, Sep 5, 2006, in forum: Microsoft Dot NET Framework
    Replies:
    8
    Views:
    856
    Guest
    Sep 7, 2006
  4. Mark

    app.config and user.config files

    Mark, Feb 1, 2007, in forum: Microsoft Dot NET Framework
    Replies:
    9
    Views:
    382
    Oliver Sturm
    Feb 12, 2007
  5. Guest
    Replies:
    1
    Views:
    1,070
    Walter Wang [MSFT]
    Feb 5, 2007
Loading...

Share This Page