Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio: reset user settings when debugging

Tags:

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.

like image 591
Reinhard Avatar asked May 25 '10 09:05

Reinhard


People also ask

How do I reset Visual Studio to default settings?

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.

How do I change Debug config in Visual Studio?

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).


1 Answers

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)

like image 154
Smolla Avatar answered Sep 22 '22 01:09

Smolla