在.NET 4.5框架不存在ConfigurationManager中类 [英] ConfigurationManager Class not exist on .NET 4.5 Framework
本文介绍了在.NET 4.5框架不存在ConfigurationManager中类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我刚开始使用.NET框架4.5的C#的工作。我使用Windows窗体应用程序。我已经做了必要的进口,如:
使用System.Configuration;
但实际上ConfigurationManager中的类似乎是不退出。我曾尝试使用ConfigurationSettings代替,但视觉STDIO告诉我,这是过时的,由ConfigurationManager中更换!
这是code块相关的问题:
Int32.Parse StartingMonth = int.parse(ConfigurationManager.AppSettings [StartingMonthColumn]);
所以,你能帮帮我吗?
解决方案
- 确保
System.Configuration.dll
您添加到项目中。如果你已经添加了它,尝试删除并重新添加。 - 把光标放在
ConfigurationManager中
则preSS <大骨节病> CTRL 骨节病> + ,看看它表明你
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;
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"]);
So , could you please help me ?
解决方案
- Make sure that you add
System.Configuration.dll
to the project. If you already added it, try to remove and add it again. - Put the cursor on
ConfigurationManager
then press ctrl+., and see what it suggests you.
这篇关于在.NET 4.5框架不存在ConfigurationManager中类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文