{"id":22065870,"url":"https://github.com/karenpayneoregon/appsettings-external-tool","last_synced_at":"2026-04-15T13:33:35.995Z","repository":{"id":110840277,"uuid":"532622979","full_name":"karenpayneoregon/appsettings-external-tool","owner":"karenpayneoregon","description":"Provides an easy way to create an appsettings.json file with sql-server connections","archived":false,"fork":false,"pushed_at":"2022-10-08T15:18:25.000Z","size":131,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-14T01:34:30.263Z","etag":null,"topics":["csharp-core","tool","visual-studio-2022"],"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/karenpayneoregon.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":"2022-09-04T18:25:52.000Z","updated_at":"2022-09-04T18:29:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"2fc02c7b-f25d-4acb-97a6-48b6b72e4bd3","html_url":"https://github.com/karenpayneoregon/appsettings-external-tool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/karenpayneoregon/appsettings-external-tool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karenpayneoregon%2Fappsettings-external-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karenpayneoregon%2Fappsettings-external-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karenpayneoregon%2Fappsettings-external-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karenpayneoregon%2Fappsettings-external-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karenpayneoregon","download_url":"https://codeload.github.com/karenpayneoregon/appsettings-external-tool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karenpayneoregon%2Fappsettings-external-tool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31842937,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T13:28:40.153Z","status":"ssl_error","status_checked_at":"2026-04-15T13:28:29.396Z","response_time":63,"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":["csharp-core","tool","visual-studio-2022"],"created_at":"2024-11-30T19:22:21.436Z","updated_at":"2026-04-15T13:33:35.982Z","avatar_url":"https://github.com/karenpayneoregon.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Create appsettings.json with SQL-Server tool in Visual Studio using external tools\n\n\nA tool to create a `appsettings.json` file in the current project setup with connection strings for SQL-Server for any project not using dependency injection.\n\nBy adding the tool to external tools and using the following NuGet package [Configuration library](https://www.nuget.org/packages/ConfigurationLibrary/) the project can easily create a connection string for either Entity Framework Core or SqlClient data provider.\n\n## With EF Core\n\n- Add the package [Configuration library](https://www.nuget.org/packages/ConfigurationLibrary/) to a project\n- Run the tool\n- Add the following to the DbContext\n\n```csharp\nprotected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)\n{\n    if (!optionsBuilder.IsConfigured)\n    {\n        optionsBuilder.UseSqlServer(ConfigurationHelper.ConnectionString());\n    }\n}\n```\n\n## EF Core 7\n\nEncrypt defaults to true for SQL Server connections (see [this page](https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-7.0/breaking-changes#encrypt-true))\n\nUsing `-f $(ProjectDir) -u no` will ensure there are no issues moving forward.\n\n\n\n## With SqlClient\n\n- Add the package [Configuration library](https://www.nuget.org/packages/ConfigurationLibrary/) to a project\n- Run the tool\n- Create a - Create a Add the following to the DbContext as shown below\n\n```csharp\nusing var cn = new SqlConnection(ConfigurationHelper.ConnectionString());\n```\n\n\n## Running as an external tool\n\n![Running](assets/running.png)\n\n\n# Added to external tools\n\n![Tools Menu](assets/toolsMenu.png)\n\n## Tool 1\n\nConfigure to add encryption to connection string\n\n| Property        | Value      | \n|:------------- |:-------------|\n| Title | Generate appsettings with encryption | \n| Command | Location of the executable | \n| Arguments | -f $(ProjectDir) -u yes |\n| Initial directory | $(ProjectDir) |\n\n## Tool 2\n\nConfigure without encryption for connection string\n\n| Property        | Value      | \n|:------------- |:-------------|\n| Title | Generate appsettings without encryption | \n| Command | Location of the executable | \n| Arguments | -f $(ProjectDir) -u no | \n| Initial directory | $(ProjectDir) |  \n\n### Specify localDb or SqlExpress\n\n`-l no` uses SqlExpress while `-l yes` will use localDb for either of the above setups.\n\n![Adding](assets/adding.png)\n\n# ASP.NET Core\n\nCurrently not configured as there are two many variables in the structure of the appsettings.json file. What you can do is run the tool with an existing appsettings.json file and a unique appsettings file is created so the settings can be copied to your appsettings file.\n\nWill be thinking about a work around for this.\n\nHere is how I use the connections\n\n```json\n{\n  \"Logging\": {\n    \"LogLevel\": {\n      \"Default\": \"Information\",\n      \"Microsoft.AspNetCore\": \"Warning\"\n    }\n  },\n  \"AllowedHosts\": \"*\",\n  \"ConnectionsConfiguration\": {\n    \"ActiveEnvironment\": \"Development\",\n    \"Development\": \"Server=(localdb)\\\\MSSQLLocalDB;Database=OED.Pizza;Trusted_Connection=True;Encrypt=False\",\n    \"Stage\": \"Stage connection string goes here\",\n    \"Production\": \"Prod connection string goes here\"\n  }\n}\n```\n\n\n\n# Summary\n\nExternal Tools in Visual Studio offer the user to add tools such as this one along with other tools and to open common folders like the current bin folder of a selected project. Think about what you can do with external tools.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarenpayneoregon%2Fappsettings-external-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarenpayneoregon%2Fappsettings-external-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarenpayneoregon%2Fappsettings-external-tool/lists"}