In a C# Winforms-App I have several user settings stored.
Is there an easy way to clear those settings each time I start debugging the project from Visual Studio 2008?
Otherwise it always starts up with the settings from the last debug-session.
Reset settingsSelect Tools > Import and Export Settings from the menu bar to open the Import and Export Settings Wizard. In the Import and Export Settings Wizard, select Reset all settings, and then select Next. On the Save Current Settings page, select either Yes or No, and then select Next.
In Solution Explorer, right-click the project and choose Properties. In the side pane, choose Build (or Compile in Visual Basic). In the Configuration list at the top, choose Debug or Release. Select the Advanced button (or the Advanced Compile Options button in Visual Basic).
Had the same question and found an answer here: https://stackoverflow.com/a/2117359/488794
Properties.Settings.Default.Reset()
You can use this following statement to only reset if you're debugging:
if(Debugger.IsAttached) Settings.Default.Reset();
tested VS2012 .Net 4.0 (Reference)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With