Saturday, September 28, 2013

User.config Problem when exe runs on system startup

I can't say for certain without seeing more code, but it sounds like this may have something to do with the initial working directory when the app starts up.


It sounds like when you double-click the app's icon to launch the app from Windows Explorer, the initial working directory of the process is the app directory. Since the app config file is in this same directory, then things work.


It also sounds like when you launch the app from System Startup, the initial working directory of the process is somewhere else -- maybe C:\Windows\System32, perhaps? -- and, since the app config file is not in that same directory, but is instead with the app in a separate directory, the app settings can't be found and aren't loaded.


I'd start by investigating in that area. It's just a guess, but it should be looked into.


No comments:

Post a Comment