My.Settings.Save debugging clean

1.3k views Asked by At

I am trying to create a string1 in My.Settings and used the My.Settings.Save method and it is working perfect. The problem is that the default value is "My Name is X" and the given saved value at runtime is "My Name is Z", when the next time I run the debugger in VS2010 with F5 key i am getting the new value only not the original x, I tried to clean, rebuild the app but still the new value is only showing up, how to debug with original values?

Thank you.

1

There are 1 answers

4
Eduardo Brites On BEST ANSWER

I think you have to delete the generated settings file (stored in C:/Users/...) in each debug session, or else in your code inside the initialize part you could do something like this:

#if Debug
     YourApp.Properties.Settings.Default.String1 = "My name is X";
     YourApp.Properties.Settings.Default.Save();
#endif