Results 1 to 2 of 2

Thread: [2.0] can't read the content in <appSettings> in the config file

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    Unhappy [2.0] can't read the content in <appSettings> in the config file

    I am trying to read content in the <appsettings> tag in the config file in my windowsservice application. for some reason, I can't get any thing.

    FileWatcherService.exe.Config file:

    <?xml version="1.0" encoding="utf-8" ?>

    <configuration>

    <appSettings>


    <add key="FileNameAndPath" value="C:\Code\SavvysoftValuations" />


    </appSettings>

    </configuration>

    Code to read:

    _FilePath = System.Configuration.ConfigurationSettings.AppSettings.Get("FileNameAndPath");

  2. #2
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Re: [2.0] can't read the content in <appSettings> in the config file

    Try this if your using 2.0.

    Code:
    _FilePath = System.Configuration.ConfigurationManager.AppSettings["FileNameAndPath"]

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