0

Im creating a .net standard 2.0 library and I need to read web.config(.net framework) when a .net application is using my library and appsettings.json(.net core 2.1) when a .net core 2.1 application is using my library. Some people suggested to use System.Configuration.ConfigurationManager which can be used universally to read files but a .net core 2.1 application fails to read the config file.

Can anyone help me on this? And also suggest me If Im doing the right way(like reading config from class libraries)

Sushruth
  • 155
  • 2
  • 11
  • 1
    Instead of your library having dependencies on a configuration provider you could provide your own interface which the client applications can each implement in their own way. – Lennart Stoop Oct 25 '18 at 20:33
  • Possible duplicate of [Access Web.config settings in Asp.Net Core App?](https://stackoverflow.com/questions/40186445/access-web-config-settings-in-asp-net-core-app) – cbp Oct 25 '18 at 22:25

0 Answers0