question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.Net Core appsettings.json connection string

See original GitHub issue

Not sure if it is just me, but I am not able to get the DataConnection to pick up the connection string from the config file in a .Net core WebApi app.

I’ve tried the normal web.config, appsettings.json, app.config and none of them work. I’ve tried:

  1. Linq2DB-1.7.6
  2. Linq2DB Core and
  3. linq2db.Core -Version 1.7.7-rc547 in a blank, .Net Core (.Net Framework) WebApi project in VS2015.
public class DbContext : LinqToDB.Data.DataConnection
{
    public DbContext(string configuration) : base(configuration)
    {
        ..//
    }
}

using (var dtx = new DbContext("DataConnection"))
{
     ..//
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

0reactions
filippobottegacommented, Apr 8, 2020

Hello, now for .Net Core there is the package System.Configuration.ConfigurationManager. Is it possible to update documentation to explain how to use ConfigurationManager in .Net Core console applications?

Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Store and read connection string in appsettings.json
Store and read connection string in appsettings.json ... In .NET Core and ASP.NET Core applications the application settings are stored in a JSON...
Read more >
Connection Strings - EF Core
In ASP.NET Core the configuration system is very flexible, and the connection string could be stored in appsettings.json , an environment ...
Read more >
c# - Get ConnectionString from appsettings.json instead of ...
You can also do this in ASP.NET Core 2 by defining the connection string in your appSettings.json file. Then in your Startup.cs you...
Read more >
How to Get Connection String from Appsettings.json? .net ...
Add an AppSettings.json File. Right-click on the project and select 'Add New Item'. In the search box type 'json' keyword and select 'JavaScript...
Read more >
Net Core: Read Connection String from AppSettings.json file
json file, right click on the Project in Solution Explorer. Then click Add, then New Item and then choose App Settings File option...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found