How to use a App.config file in WPF applications?

前端 未结 8 2140
既然无缘
既然无缘 2020-12-04 13:59

I created an App.config file in my WPF application:


         


        
相关标签:
8条回答
  • 2020-12-04 14:44

    You have to reference the System.Configuration assembly which is in GAC.

    Use of ConfigurationManager is not WPF-specific: it is the privileged way to access configuration information for any type of application.

    Please see Microsoft Docs - ConfigurationManager Class for further info.

    0 讨论(0)
  • 2020-12-04 14:44

    This also works

    WpfApplication1.Properties.Settings.Default["appsetting"].ToString()
    
    0 讨论(0)
提交回复
热议问题