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 200
Adding to the above answers, here a copy-paste solution that works for most settings:
rmdir /q /s %localappdata%\[company name]\[AppName]
Note that for most cases it's best to delete everything under %localappdata%[company name]. Check the app data stored there and choose what's best for you.
Based on other answers: just search on C:
or C:\Users\<YourUser>
for user.config
and delete or rename that file.
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)
Run->Type "appdata"
Navigate to Local->/
Delete all files related to the project
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
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]\