ConfigurationManager.AppSettings in returning null

后端 未结 4 1943
猫巷女王i
猫巷女王i 2020-12-16 15:26

I am using ConfigurationManager.AppSettings[myKey] to read a value from the app.config file in my windows application, but the value returned is always null, even though the

4条回答
  •  萌比男神i
    2020-12-16 16:18

    i have two project in my solution first i add app.config file in class library project which all instances is call from console application i added these entries in config file in class lib project

     
     
     
    
    

    it was throwing null exception when i get these in a class in class library project but when i delete app.config from class Library project and added in Console project it works.Cheers

    Note: Class lib project reference is added in console

提交回复
热议问题