Reputation: 8753
Everytime I am saving settings with Settings.Default.Save
, I notice getting different settings when in debugging mode. I assume this is because of the .vshost.exe debugging process.
I think you my also get different settings running Debug vs. Release binaries.
Is there a simple way to get all calls to Settings.Default.Save
to always save in the same location?
Upvotes: 0
Views: 55
Reputation: 56697
You have to keep in mind the following things:
User settings
User settings are saved within the user's profile and do not reflect in the .exe.config
file in \bin\debug
or even the app.config
original file.
Running outside Visual Studio vs. Debugging within Visual Studio
When you run an application outside Visual Studio, the user settings will be saved in a different location within your profile than when running the application in Visual Studio. They are treated as if they were different "installations" of the same application.
There is no way that I know of that would cause the mechanism to always read the same file. And it may also not be what you want.
Imagine you have the application running as release version on your system. At the same time you're the developer of the application and you constantly add features, testing them against some test system. You'd frequently overwrite your test-settings with live-settings and vice versa. That's not really what you would want...
Upvotes: 1