I have the following line of code:
MsgBox(ConfigurationManager.AppSettings.Get("Path"))
and inside the app.config file this xml:
<appSettings>
<add key="PATH" value="myPath"/>
</appSettings>
I then deploy the solution and save it (the exe and the xml-config file) to the appdata-roaming path:
C:\Users\<username>\AppData\Roaming\<solutionname>
when I run it by double click, the massage-box shows the value “myPath”. When I set it to run in autostart and restart my machine, the massege-box is empty (null). Why the config-xml file can’t be read on autostart?
Consider having a look at this documentation ConfigurationManager.OpenExeConfiguration
It says :
I’m not sure if this is relevant (since you said it works when you double click) . But no harm if you try.