Deleting old user 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
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.
精彩评论