zoukankan      html  css  js  c++  java
  • (转)关于ConfigurationSettings.AppSettings”已过时的问题

    原文地址:https://www.cnblogs.com/Shadow3627/archive/2013/03/26/2983484.html

    使用VS 2005以上的版本时,习惯性的使用ConfigurationSettings类来读取应用程序配置文件的信息时,却被编译器提示说

    警告“System.Configuration.ConfigurationSettings.GetConfig(string)”已过时:“This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.GetSection”

    警告   1 “System.Configuration.ConfigurationSettings.AppSettings”已过时:“This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings”

    注意:默认没有引用ConfigurationManager类,所以找不到System.Configuration命名空间的 ConfigurationManager类.

    解决:首先添加对System.Configuration.dll 文件的引用:在将"System.Configuration.ConfigurationSettings.GetConfig替换为System.Configuration.ConfigurationManager.GetSection

    将“System.Configuration.ConfigurationSettings.AppSettings”替换为System.Configuration.ConfigurationManager.AppSettings”

  • 相关阅读:
    maven settings
    java.util.Base64
    Centos 7 下 LAMP 部署
    Cisco N3K VPC+HSRP+ospf 配置
    centos 7 下多网卡绑定+ vlan 网卡配置
    centos 7 下 cobbler 安装
    hive0.12 rcfile gzip 测试
    Hive内部表外部表转化分析(装)
    hadoop2.2.0 + hbase 0.94 + hive 0.12 配置记录
    hbase 问题记录
  • 原文地址:https://www.cnblogs.com/wonder223/p/14014892.html
Copyright © 2011-2022 走看看