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?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
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:
    908
    DPlsn
    Mar 5, 2004
  2. Guest
    Replies:
    1
    Views:
    326
    Julie Lerman
    Jan 15, 2006
  3. 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,974
    Guest
    Aug 14, 2007
  4. Guest

    app.config and assembly config in My.Config

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

    app.config and user.config files

    Mark, Feb 1, 2007, in forum: Microsoft Dot NET Framework
    Replies:
    9
    Views:
    584
    Oliver Sturm
    Feb 12, 2007
  6. Guest
    Replies:
    1
    Views:
    1,519
    Walter Wang [MSFT]
    Feb 5, 2007
  7. Replies:
    5
    Views:
    628
    John Saunders [MVP]
    Jul 10, 2007
  8. Yash

    Extending app.config with addtional config

    Yash, Mar 4, 2009, in forum: Microsoft Dot NET Framework
    Replies:
    3
    Views:
    1,430
    sloan
    Mar 9, 2009
Loading...