About 51 results
Open links in new tab
  1. c# - Get ConnectionString from appsettings.json instead of being ...

    Aug 21, 2017 · I would disagree! "Copy appsettings.json " with the connection string inside is as bad as stating the connection string in 2 places! Who will be in charge to keep it insync?

  2. c# - How to set connectionstring from appsettings.json in Entity ...

    May 7, 2019 · My Connectionstring is set in the appsettings.json file an I copy this to the output directory when the project builds. I have tried different ways to get the connectionstring from the appsettings …

  3. How to get ConnectionString from appsettings.json file?

    Feb 18, 2021 · But if your goal is to override the appsettings.json here is a little guide The default order is 1) appsettings.json, 2) appsettings. {env}.json, 3) secrets.json, 4) environment variables, 5) …

  4. How can I easily read connection string from appsettings.json in .NET …

    Oct 31, 2024 · How can I easily read connection string from appsettings.json in .NET 8.0? Asked 1 year, 4 months ago Modified 1 year, 4 months ago Viewed 3k times

  5. Entity Framework Core: use connection string from appsettings.json

    Sep 3, 2024 · 0 I'm trying to use appsettings.json to store the database connection string to use different strings for build configurations. But, I'm getting this exception: System.InvalidOperationException: A …

  6. c# - Getting Database ConnectionString from ... - Stack Overflow

    Nov 16, 2022 · How are we supposed to inject the connection string based off the environment in .Net 7? I do have the code to read from the base appsettings.json file and that works, there is also a …

  7. How to read connection string in .NET Core? - Stack Overflow

    I want to read just a connection string from a configuration file and for this add a file with the name "appsettings.json" to my project and add this content on it: { "ConnectionStrings": { "

  8. how configure appsettings.json to have a different connection string ...

    Jun 2, 2021 · Step 2. Copy your appsettings.json to appsettings.Development.json Now your app will use appsettings.Development.json to override the default appsettings.json file. You can add your …

  9. Store / Retrieve ConnectionString from appSettings.json in ASP.net …

    May 24, 2018 · I'm looking for the best practice way to store a connection string in appsettings.json in a .net Core 2 MVC app (like you do in web.config in MVC 5). I want to use Dapper not EF (I found …

  10. How to correctly store connection strings in environment variables for ...

    Jul 5, 2017 · Not ASPNETCORE_TestDb, this would assume that your connection string is in the root element of the appsettings.json, but it's in the connection string, so it should be …