How to declare\read value from app.config file - VB Express 2010
Posted on 2011-03-05
I need to be able to set the web service URL by editing the .exe.config file when I deploy this to end users.
This setting is a Web Service URL type in My Project>>Settings.
I tried to read the value this way but get an error:
Public ws_test As New localhost.IDataCollectionservice()
ws_test.Url = System.Configuration.ConfigurationManager.AppSettings("JobBOSS_AutoCrib_Integration_localhost_IDataCollectionservice")
"An error occurred creating the form. See Exception.InnerException for details. The error is: Value cannot be null.
Parameter name: uriString"
I've checked My Project>>Settings and this is the value for this object. If I can't get it to read my local web service path, I know it's not going to work when I try to edit the .exe.config file on an end user's machine.
Your thoughts on how to resolve this would be appreciated.