none
ConfigurationManager is not declared. It may be inaccessible due to its protection level. V4.5 RRS feed

  • Question

  • How to resolve the error and other strange errors happening after converting web application from framework 3.5 to framework 4.5 using visual studio 2012?

    The reference to libraries is there (runtime v4.0).  The code simply doesn't compile. The code is in VB.NET.

    Wednesday, August 24, 2016 3:55 PM

Answers

  • I had that already.  The error is weird

    If you have already added "System.Configuration" dll, then try removing the library and add that reference again. Sometimes it works.

    Or you can also try this way

    System.Configuration.ConfigurationManager.ConnectionStrings["MyConnectionString"]


    Gaurav Khanna | Microsoft MVP | Microsoft Community Contributor

    • Proposed as answer by Hart Wang Friday, September 2, 2016 7:46 AM
    • Marked as answer by DotNet WangModerator Wednesday, September 7, 2016 3:01 AM
    Friday, August 26, 2016 6:09 PM

All replies

  • Add "System.Configuration" dll from Project Menu -> Add References

    Gaurav Khanna | Microsoft .NET MVP | Microsoft Community Contributor

    Wednesday, August 24, 2016 7:46 PM
  • I had that already.  The error is weird
    Thursday, August 25, 2016 6:08 PM
  • I had that already.  The error is weird

    If you have already added "System.Configuration" dll, then try removing the library and add that reference again. Sometimes it works.

    Or you can also try this way

    System.Configuration.ConfigurationManager.ConnectionStrings["MyConnectionString"]


    Gaurav Khanna | Microsoft MVP | Microsoft Community Contributor

    • Proposed as answer by Hart Wang Friday, September 2, 2016 7:46 AM
    • Marked as answer by DotNet WangModerator Wednesday, September 7, 2016 3:01 AM
    Friday, August 26, 2016 6:09 PM