reading from app.config file

后端 未结 8 2389
不知归路
不知归路 2020-11-29 19:34

I am trying to read StartingMonthColumn and CategoryHeadingColumn from the below app.config file using the code

ConfigurationSettings.AppSettings[\"StartingM         


        
8条回答
  •  [愿得一人]
    2020-11-29 20:18

    ConfigurationSettings.AppSettings is deprecated, see here:

    http://msdn.microsoft.com/en-us/library/system.configuration.configurationsettings.appsettings.aspx

    That said, it should still work.

    Just a suggestion, but have you confirmed that your application configuration is the one your executable is using?

    Try attaching a debugger and checking the following value:

    AppDomain.CurrentDomain.SetupInformation.ConfigurationFile
    

    And then opening the configuration file and verifying the section is there as you expected.

提交回复
热议问题