views:

179

answers:

2

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.

Thank you!

A: 

Add a pre-build action to delete:

%USERPROFILE%\Local Settings\Application Data\[AppName]\...\[Version]\user.config

or if your version number changes alot just delete

%USERPROFILE%\Local Settings\Application Data\[AppName]\

Jan Jongboom
Any chance you would know how to do the same thing for VS 2010??? I just messed up my debugger view and can't figure out how to get back to default... (grrr GUIs...)
Trevor Boyd Smith
A: 

Here are two possible ways to do it:

  • use either the pre build or post build event command line, you put delete commands and such in there or run a batch file or script

  • have a play with the Start Action options of the start up project, you can specify an external program with command line arguments to be run first

slugster