{"id":21900327,"url":"https://github.com/philipmat/appsettingsmerger","last_synced_at":"2026-05-21T05:07:12.862Z","repository":{"id":188940485,"uuid":"679717552","full_name":"philipmat/AppSettingsMerger","owner":"philipmat","description":"Merges multiple .NET appSettings.json files into an efficient layering structure","archived":false,"fork":false,"pushed_at":"2023-09-08T16:56:50.000Z","size":11,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T05:44:52.084Z","etag":null,"topics":["asp-net-core","configuration-files","settings-management"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/philipmat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-17T13:12:11.000Z","updated_at":"2023-08-17T13:13:21.000Z","dependencies_parsed_at":"2025-01-27T06:37:52.766Z","dependency_job_id":null,"html_url":"https://github.com/philipmat/AppSettingsMerger","commit_stats":null,"previous_names":["philipmat/appsettingsmerger"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/philipmat/AppSettingsMerger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipmat%2FAppSettingsMerger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipmat%2FAppSettingsMerger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipmat%2FAppSettingsMerger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipmat%2FAppSettingsMerger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/philipmat","download_url":"https://codeload.github.com/philipmat/AppSettingsMerger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipmat%2FAppSettingsMerger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33289548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T02:57:32.698Z","status":"ssl_error","status_checked_at":"2026-05-21T02:57:31.990Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asp-net-core","configuration-files","settings-management"],"created_at":"2024-11-28T15:07:26.068Z","updated_at":"2026-05-21T05:07:12.846Z","avatar_url":"https://github.com/philipmat.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AppSettings Merger\n\nThe typical ASP.NET Core project supports stacking `appSetttings.json` files\nso that more specific files, e.g. `appSettings.{Environment}.json` files, overwrite\nthe more generic `appSettings.json` file.\n\nThe purpose is to have most settings placed in `appSettings.json` and\nplace in the environment overwrite files only those settings which are different\nfrom the base-line.\n\nIn my experience, long-running projects tend to duplicate settings between the\n`appSettings.Development.json` and `appSettings.Production.json`\nor `appSettings.Staging.json`, and these settings no longer get migrated back\ninto the `appSettings.json`.  \nThis, in turn, makes configuration management a bit more difficult over time,\nas well as other operations like PR reviews, deployments, etc.\n\nThis project solves this case where settings are spread inefficiently over several\nfiles and attempts to re-create a base `appSettings.json` file and only keep\nthose values that are different in other files.\n\n## Operation\n\nThe parameters of the project are a list of files to inspect and attempt to merge.  \nThe \"algorithm\" is fairly naive so the `appSettings.json` file should be specified first.\n\nFor example, assuming:\n\n* `appSettings.json` contains:\n\n```json\n{\n  \"Publish\": {\n    \"TopicName\": \"books-read\"\n  }\n}\n```\n\n* `appSettings.Development.json` contains:\n\n```json\n{\n\"Publish\": {\n    \"TopicName\": \"books-read-dev\",\n    \"MaxMessages\": 5\n},\n\"ConnectionStrings\": {\n    \"Default\": \"Server=localhost;Database=books;Trusted_Connection=True\"\n}\n}\n```\n\n* `appSettings.Production.json` contains:\n\n```json\n{\n  \"Publish\": {\n    \"TopicName\": \"books-read\",\n    \"MaxMessages\": 10\n  },\n  \"ConnectionStrings\": {\n    \"Default\": \"Server=my-prod-serve;Database=books;Trusted_Connection=True\"\n  }\n}\n```\n\nCalling AppSettingsMerger with\n`appSettings.json appSettings.Development.json appSettings.Production.json`\nwill result in:\n\n```json\n// appSettings.json\n{\n  \"Publish\": {\n    \"TopicName\": \"books-read\",\n    \"MaxMessages\": 5\n  },\n  \"ConnectionStrings\": {\n    \"Default\": \"Server=localhost;Database=books;Trusted_Connection=True\"\n  }\n}\n\n// appSettings.Development.json\n{\n  \"Publish\": {\n    \"TopicName\": \"books-read-dev\"\n  }\n}\n\n// appSettings.Production.json\n{\n  \"Publish\": {\n    \"MaxMessages\": 10\n  },\n  \"ConnectionStrings\": {\n    \"Default\": \"Server=my-prod-serve;Database=books;Trusted_Connection=True\"\n  }\n}\n```\n\nEach environment file now contains the values that differ from `appSettings.json`\nmaking, in this author's humble opinion, easier to reason about settings for each\nenvironment.\n\n## How to run\n\nThere are no releases at this time. Clone the project then use `dotnet run --project`\nto run it.\n\nFor example, if you cloned it in `~/Projects/AppSettingsMerger` and you would like\nto merge the files in `~/Projects/MyCompany/MyWebApp/MyWebApp.API`,\nyou would navigate to `~/Projects/MyCompany/MyWebApp/MyWebApp.API` and then\ninvoke:  \n`dotnet run --project=~/Projects/AppSettingsMerger/AppSettingsMerger.csproj appSettings.json appSettings.Development.json appSettings.Production.json`\n\nThere is a convenient `--dry-run` flag you can specify to show the output, without\naltering the files, but typically I found that leaving it out, having AppSettingsMerger\nchange the files, then using even the barest VCS commands to diff the changes\nproduced better results.  \nAfter all, undoing is just a `git checkout -f` away.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilipmat%2Fappsettingsmerger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilipmat%2Fappsettingsmerger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilipmat%2Fappsettingsmerger/lists"}