'System.Configuration.ConfigurationSettings.AppSettings' is obsolete

前端 未结 12 1859
被撕碎了的回忆
被撕碎了的回忆 2020-12-13 03:22

I got the following warning

\'System.Configuration.ConfigurationSettings.AppSettings\' is obsolete: \'\"This method is obsolete, it has been replace

12条回答
  •  南方客
    南方客 (楼主)
    2020-12-13 04:18

    After adding the reference using System.Configuration; at the top of the class. Still the same warning remains.

    In Code Behind:

    Instead of ConfigurationSettings.AppSettings["ConnectionString"]

    Use ConfigurationManager.AppSettings["ConnectionString"]

    By Default the System.configuration Dll will be added in your project.

    In Web.config or App.config:

     
    

提交回复
热议问题