I am new to VS 3.5 and I am writing a console app that needs to pull some key values from the app.config file.
I have:
Imports System.Configuration
and I am trying to reference ConfigurationManager.AppSettings
but this generates an error:
Name ConfigurationManager is not declared
What am I missing?
ConfigurationManager was added to support ASP.NET Core's new WebApplication model, used for simplifying the ASP.NET Core startup code.
Right click the project and choose add reference, browse "Assemblies" and tick the System. Configuration assembly.
ConfigurationManager is the class which helps to read data from configurations. Provides access to configuration files for client applications. Namespace: System.Configuration. To use the ConfigurationManager class, your project must reference the System.
Make sure you have a reference to the assembly System.Configuration.dll
Project -> Add References -> .NET -> select System.Configuration
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With