hii all!
When i tried to access a value from the configuration file (ConfigurationManager.AppSettings("ADMIN"))
i am getting an error:
'ConfigurationManager.AppSettings' is not declared or the module containing it is not loaded in the debugging session.

can you please anyone help me who have experienced the
above said error?

thanks in advance,

best regards,

Ammar.

Dani AI

Generated

Short expert note tying the earlier replies together: the debugger message about "'ConfigurationManager.AppSettings' is not declared or the module containing it is not loaded in the debugging session" is most often a deployment/reference/namespace issue or simply the debugger trying to evaluate the expression before the runtime has loaded the config assembly. is correct to check the project reference; is correct to check that a key exists in the configuration file — both steps are required.

Quick checklist (triage):

  • Confirm the key exists in the correct config file and section (appSettings under the <configuration> root for desktop apps, web.config for ASP.NET). The element name should be the standard appSettings node.
  • Confirm the project references the System.Configuration assembly (Add Reference -> Assemblies / .NET -> System.Configuration).
  • In VB files that read settings, import the namespace so the symbol resolves at compile time.
' at top of a VB file
Imports System.Configuration

Debugger-specific checks:

  • Build the project in Debug configuration (no optimizations). Set a breakpoint on the line that accesses configuration and step to it. The Modules window (Debug -> Windows -> Modules) shows whether System.Configuration.dll has been loaded into the process; if it is not listed, the Watch/Immediate evaluation will report the "module not loaded" message until the runtime actually loads it.
  • If compilation fails earlier, the error is a missing reference or wrong target framework; if compilation succeeds but the Watch complains, the Modules/Breakpoints approach will reveal the runtime loading behavior.

Additional context: ConfigurationSettings is an older API; modern .NET Framework code normally uses ConfigurationManager from System.Configuration. For .NET Core / .NET 5+ projects, the configuration model differs (use the appropriate NuGet package or the Microsoft.Extensions.Configuration system). These differences explain why the same code may fail if the project target was changed.

first of all u have to declare in the webconfig file.About the key (being used),and that key can be accessed in code-behind file using--->dim con as string=configurationsettings.appsettings("manager")
...........

Hi Ammar,

First add this code to your app.config

<AppSettings>
 <add key="Conn"  value="uid=zz; pwd=****; database=XX; server=11.111.111.111"/>
</AppSettings>

and add reference of system.configuration.dll from add reference on right of your project.
then use
configurationManager.AppSettings("Conn")

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.