Can't read Web.Config

Bilalq

Member
Joined
Jul 21, 2004
Messages
24
Programming Experience
3-5
Hello,
I have a VB.Net app that calls into the web service. The web service has some configuration setting in it that I need to read, and I use the following code to read the custom configurations.......

Dim config As Specialized.NameValueCollection =
_
ConfigurationSettings.GetConfig("LPAPP_Config/client")

It comes back with nothing; as if the sepcified tag is not there. However, since I am using VB.Net app to call into the webservice, I can use the VB.Net's app.config file and it can read that without any problem with the same code. But, I need to read the web service's web.config file for the custom settings. If any one has any ideas about what is going on, please let me know. Thanks in advance.
 

levyuk

Well-known member
Joined
Jun 7, 2004
Messages
313
Location
Wales, UK
Programming Experience
3-5
It might have something to do with permissions on the folder where the web.config file is stored. Because if you have to login to view any page in that folder then you may have to do the same with the web.config file.
 

Bilalq

Member
Joined
Jul 21, 2004
Messages
24
Programming Experience
3-5
thanks for the reply. All the files are still local. I have the web server on my machine as well as the VB.Net app and the web service right now. So, I am not sure if that is the case 'cause I can browse to the folder and the file without any problem.

Thanks,
 

TechHelper

New member
Joined
Aug 25, 2006
Messages
2
Programming Experience
1-3
Check the syntax of your call, web.config is very particular for example:

<customErrors mode="off"/> 'Doesnt Work...

<customErrors mode="Off"/> 'Works!
 
Top Bottom