https://discord.umbraco.com logo
#package-development
Title
# package-development
s

Sean Thorne

12/23/2022, 12:20 PM
I'm building out on my package and the dev's can currently edit the settings in appsettings.json, if I wanted to build out a section a la usync, where should I start googling on how to manipulate the appsettings.json progrmatically? My google-fu isn't doing my any justice
The only path I seem to be able to see a way through is to read the file, make changes, then write it back
k

kevinjump

12/23/2022, 2:13 PM
yeah - not recommended that you do that, because while it looks like the settings are only coming from appsettings.json they are actually being merged from multiple sources (e.g environment, key stores, multiple appsettingss files) the current recommendation is to show your users what to edit, and in v11 you can create and add your own schema file so when they edit the appsettings.json file they can see the options (usync has some code in for that). or if the settings are only ever for individual installations (e.g not something that has to be deployed or the same on a load of setups) you could use the DB (their is a KeyValueService in umbraco you can use for simple values)
s

Sean Thorne

12/23/2022, 2:24 PM
> the current recommendation is to show your users what to edit I think I will just do this!
Thanks!