0

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>
user1673665
  • 516
  • 3
  • 8
  • 21
  • Does [How do I read the "System.ServiceModel" configuration section group from a class library?](https://stackoverflow.com/questions/38971995/how-do-i-read-the-system-servicemodel-configuration-section-group-from-a-class) help? – Andrew Morton Jun 20 '23 at 12:51

0 Answers0