.NET 4.5 Framework 上不存在 ConfigurationManager 类 [英] ConfigurationManager Class not exist on .NET 4.5 Framework

查看:23
本文介绍了.NET 4.5 Framework 上不存在 ConfigurationManager 类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始使用 C# 的 .NET Framework 4.5.正在使用 Windows 窗体应用程序.我已经完成了所需的导入,例如:

I just start working with .NET Framework 4.5 of C#. Am using Windows Form Application. I have do the needed imports such as :

using System.Configuration;

但实际上 ConfigurationManager 类似乎并没有退出.我曾尝试改用 ConfigurationSettings ,但 Visual Stdio 告诉我它已过时并被 ConfigurationManager 取代!

But actually the ConfigurationManager class seems that it is not exits. I have tried to use ConfigurationSettings instead , but Visual Stdio telling me that it is obsolete and replaced by ConfigurationManager !

这是与问题相关的代码块:

This is chunk of code related to the problem :

Int32.Parse StartingMonth = int.parse(ConfigurationManager.AppSettings["StartingMonthColumn"]);

那么,你能帮我吗?

推荐答案

  1. 确保将 System.Configuration.dll 添加到项目中.如果您已添加,请尝试删除并重新添加.
  2. 将光标放在 ConfigurationManager 上,然后按 ctrl+.,看看它给你什么建议.
  1. Make sure that you add System.Configuration.dll to the project. If you already added it, try to remove and add it again.
  2. Put the cursor on ConfigurationManager then press ctrl+., and see what it suggests you.

这篇关于.NET 4.5 Framework 上不存在 ConfigurationManager 类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆