Using an external .config file in configSource produces error

前端 未结 4 1162
迷失自我
迷失自我 2021-01-04 01:35

I was playing around with how to use the Configuration Manager to read/write custom sections in the App.config file for a WPF application in C#. I read this excellent articl

4条回答
  •  有刺的猬
    2021-01-04 02:18

    I got the same error. In my case is due that I have keys in two files, then detect appSettings tag as duplicated.

    if you need conserve some project related keys in web.config and your personalized key in another file (recommended for security reasons), use file property instead of configSource.

    web.config file:

    
      
        
      
    
    

    AppSettings.config file:

    
    
    
      
      
    
    

    Hope it help others!

提交回复
热议问题