.NET version 4.5.2 Solution explorer , right click References -> Add reference...
In the new window choose Assemblies and fill in "System.configuration" in the search box. Is the checkbox checked? If not, hover over it, select it.
.NET version 4.6.1 It could be that you forgot to add the nugget package?
In the solution explorer , right click References , choose Manage Nugget Packages..
Under the Browse , fill in "System.Configuration.ConfigurationManager". Choose the one from Microsoft and see what the tab on the right says. Install if not already installed.
A quick update that this may also happen when mixing .net core and .net framework assemblies.
In my case is was a .net framework test project referencing a mixture of .net standard and .net framework projects. Once I moved the test into a .net core test project the code runs fine.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.