Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deleting old user settings

Tags:

.net

settings

I am using the standard .NET Settings functionality, which allows be to store settings under the user and application scope.

I have noticed that every time I do an installation of a new build it creates a new folder for the settings and a new settings file.

I have worked out how to use the Upgrade method update the new settings with the old ones. However I want to delete the old folders so they don't clutter up the system.

I could manually delete the files and folders using the IO Functionalities of .NET, but I was wondering if there is an in built way for the Settings functionality.

Does anyone know the answer?

Many thanks,

Matt

like image 280
Matthew Bill Avatar asked Jul 28 '10 14:07

Matthew Bill


1 Answers

A non-direct answer is that using a custom SettingsProvider to create the settings in a place like

AppData\Local\CompanyName\ProductName\

without the default version name and other hash strings.

In this way you can always ensure that you're using one user settings. The downside is that you might run into issues like collisions with other apps or spoofing.

like image 157
AZ. Avatar answered Sep 20 '22 15:09

AZ.