C
C#2w ago
Jacko

Configuring a spectre cli app:

What’s the best way to configure a cli app to have a config file users can modify to customise parts of the application such as connection strings ?
4 Replies
Angius
Angius2w ago
A JSON file Somewhere in AppData, or next to the .exe
Jacko
JackoOP2w ago
Do I need to check the os before placing the file into the correct directory ? To follow best practices like /etc on Linux
Angius
Angius2w ago
Environment.GetFolderPath() resolves the Environment.SpecialFolder enum on Linux as well Huh, seems not many of them resolve on Linux, actually. But some do, at least
LocalApplicationData /home/username/.local/share
CommonApplicationData /usr/share
UserProfile /home/username
LocalApplicationData /home/username/.local/share
CommonApplicationData /usr/share
UserProfile /home/username
Jacko
JackoOP2w ago
Oh that’s odd, I’ll give it a try thank you !

Did you find this page helpful?