Results 1 to 3 of 3

Thread: unable to retrieve key App.Config

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    unable to retrieve key App.Config

    I have a class library in .NET 1.1 which uses its own app.config.

    There is another application I am trying to use my assembly with, and that has its own config file entitled (applicationName.config). Mine is just "app.config".

    Now, it is unable to retrieve the key from my app.config, it returns null. Any ideas whats causing the problem?

    The code:

    string keyValue = System.Configuration.ConfigurationSettings.AppSettings[key];

    The key does exists

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: unable to retrieve key App.Config

    Is there somewhere in the DLL where the particular .config file has been specified? How does it know, of itself, to look in applicationname.config?

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: unable to retrieve key App.Config

    true, after some further researching found out that its not entirely possible, there is a workaround but not good enough for my purpose so had to create my own xml format unfortunately.

    workaround was to reset the AppDomain and the config file settings to point to the new specified config file of your choice.

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width