I have a .config file named app.exe.config , where i want to update a specific attribute value named address present inside endpoint tag .I tried the below code but could not able to get whats going wrong . I am new to vb.net .Please help .
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v2.0.50727"/></startup>
<system.serviceModel>
<client>
<endpoint address="valuetobeupdated"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_CompassSMSService"
contract="CompassSMSService.CompassSMSService" name="BasicHttpBinding_CompassSMSService" />
</client>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_CompassSMSService" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
</configuration>
I have used the below code but it fails
Dim str As String = "Demo"
Dim doc As XmlDocument = New XmlDocument()
doc.Load("C:\Users\e554\Desktop\PAC\app.exe.config")
'Dim formId As XmlAttribute
For Each Attribute As XmlAttribute In doc.DocumentElement.Attributes
MessageBox.Show(Attribute.Value)
Next