I have a config file Program.exe.config located in the Program Files folder along with the executable. I am trying to update a value that the user enters into the value for the hostURI as shown below. The file is not touched during run time. However, during test the file is updated by adding a new attribute into same node as shown at the bottom.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<appSettings>
<add key="rootURI" value=""/>
</appSettings>
</configuration>
...after test...
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<appSettings>
<add key="rootURI" value="" rootURI=""/>
<add key="rootURI" value="" />
</appSettings>
</configuration>
FOLLOW US
Get the latest news in Application Packaging