1

We have a library we provide to customers in a variety of uses on a variety of platforms. We are porting it to .NET Core 3.

One of our methods allows them to pass in the name of a ConnectionString in the app.config or web.config file. I need to write this code so it runs in .NET Core (so no System.Web classes like WebConfigurationManager) and will read from the JSON config file.

But it also needs to read from web.config or app.config if it is being used on .NET standard. So this answer won't work.

What is the best way to do this?

David Thielen
  • 28,723
  • 34
  • 119
  • 193

0 Answers0