My C# DLL project has settings and the defaut values are held automatically in the xxx.dll.cong file.
When I perform a save of the settings:
Properties.Settings.Default.Save();
They are correctly read back in when I display my form. But I can't work out where the users saved version of the config file is kept? I tried to look in %localappdata% and nothing is there.
To summarise:
- This is a .Net DLL tool bring run inside BricsCAD.
- We are using the
Properties.Settingsconcept. - Where is the users
Save()version of the file kept?
Update
This is the closest conversation I could find about this subject (related to AutoCAD). It is still relevant because my tool is used by three CAD packages:
- AutoCAD
- BricsCAD
- ZWCAD
But the linked discussion does not actually answer my question. Clearly the "settings" are persisting. But they are not persisting in the %localappdat% folder for my tool. I have now tested with both BricsCAD and ZWCAD and still can't find them.
According to this article the configuration file should be updated. But the config file where the DLL is is not updating. Even though the mechanism works. The persisted settings are somewhere else.
I decided to use the MS-DOS command
findstrin a console window:I performned the test on my C drive and it came up with three files and one of them seemed to be the file of interest:
The
LOTSOFCHARACTERSwas a weird sequence of text. But when I open thatuser.configfile it had my current settings.I am not sure as the the reason for my settings being persisted in this manner.
This answer (https://stackoverflow.com/a/60117461/2287576) prrovided to a differeht question actually explains the aforementioned. To quote: