System.Configuration.ConfigurationManager not available?

后端 未结 8 1259
南方客
南方客 2020-12-09 07:30

In a VS2005 C# project I have added a reference to System.configuration. In the object browser, I can see the System.Configuration.ConfigurationManager. In Intellisense Syst

相关标签:
8条回答
  • 2020-12-09 08:04

    urgh - PICNIC error. Added ref to the wrong project in the solution...

    0 讨论(0)
  • 2020-12-09 08:07

    To answer the question (not that it hasn't been answered already 5+ times) is to add System.Configuration as a reference to your project.

    However what I would really like to highlight is that on many occasion I have added the System.Configuration.dll to my project's references, but for whatever special reason sometimes ConfigurationManager still won't show up in intellisense even after adding the reference to System.Configuration. Even if I remove the reference and add it again.

    The very simple solution to this problem is to:

    1. Add the reference to System.Configuration.dll to your project
    2. Save your files
    3. Save your Solution
    4. Close the instance of Visual Studio that is giving you a hard time
    5. Re-open your solution

    This simple exercise will get Visual Studio to behave again and stop telling you that you did not add your reference to System.Configuration. This exercise usually helps me with all inexplicable Visual Studio behaviors.

    I have had this happen to me in both VS2008 and VS2010 multiple times and it works every time.

    0 讨论(0)
提交回复
热议问题