Cannot read application parameters

G

Guest

Hello:

I've defined two application settings in my web.config file. But in the
following code :

Dim rootWebConfig1 As System.Configuration.Configuration
rootWebConfig1 =
System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Nothing)
If (rootWebConfig1.AppSettings.Settings.Count > 0) Then

sField1 = rootWebConfig1.AppSettings.Settings("field1")
sField2 = rootWebConfig1.AppSettings.Settings("field2")

End If

rootWebConfig1.AppSettings.Settings.Count always returns 0.

What am I doing wrong?

Venki
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top