Sachu Sachu - 1 year ago 93
C# Question

Settings value saved during run time is not changing from design in visual studio

At my settings file i have a parameter "Is_Running" and it value is set as 0

at run time i will check the value like below

if(Settings.Default.Is_Running == 0)
Settings.Default.Is_Running = 1;
Settings.Default.Is_Running = 0;

Due to some reason i stopped the program in the middle of execution. Now the condition is always failing. So i checked value of
using a message box and it shows "1". I checked the app config file and it shows below

<setting name="Is_Running" serializeAs="String">

Any idea why it still use "1"?

Answer Source

In VS you change the default values of settings. Real settings are stored in the path C:\Users\<UserName>\AppData\Local\<CompanyName>\<AppName>\<v‌​ersion>\user.config (for apllications).

Thanks for the answer..Since my application is windows service installe in server level the path is little different. What i done is searched for user.config then got the file and path. Changed the value to 0 and it worked fine.

Path in my case the path is

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download