I want to read the endpoint
adress
from the app.config
file with name="ZH_B_F_IMPORT"
. But I couldn't find any tutorial for VB.NET
. How can I do that?
This is what I've tried. But items
, keys
and allkeys
are all empty after assignment.
Dim appSettings = ConfigurationManager.AppSettings
Dim items As String = appSettings.Item("adress")
Dim keys As Specialized.NameObjectCollectionBase.KeysCollection
keys = appSettings.Keys
Dim allkeys As String()
allkeys = appSettings.AllKeys
The app.config
file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<client>
<endpoint address="https://devserver.com/very/very/long/url/zh_b_f_import"
binding="customBinding" bindingConfiguration="ZH_B_F_IMPORT"
contract="SOAPService._H_B_F_IMPORT" name="ZH_B_F_IMPORT" />
<endpoint address="https://devserver.com/very/very/long/url/zh_b_f_import"
binding="customBinding" bindingConfiguration="ZH_B_F_IMPORT_soap12"
contract="SOAPService._H_B_F_IMPORT" name="ZH_B_F_IMPORT_soap12" />
</client>
</system.serviceModel>
</configuration>