0

I am working an asp.net core 3.1 web project and now I am including some other classes from another .Net framework project.

The issue is that those classes in the other .Net framework project depends on many configuration lines stored in an App.config file, and I find it hard to put all those configurations somehow within the App.settings file.

Is there anyway to include App.config besides App.settings to a web application

Panagiotis Kanavos
  • 120,703
  • 13
  • 188
  • 236
Alazar Komar
  • 223
  • 3
  • 12
  • 1
    The real solution is to fix that project to *not* depend on `app.config` directly. You can use `IConfiguration` in .NET Old projects as `Microsoft.Extensions.Configuration` is a .NET Standard library. You can add `Microsoft.Extensions.Configuration.Abstractions` to the .NET Old project and use it to read the configuration supplied by the client objects – Panagiotis Kanavos Oct 22 '20 at 16:05
  • no because I want to include this app.config to my web project – Alazar Komar Oct 22 '20 at 16:23
  • Actually, that's the answer. Either use `Configuration` instead of `app.config`, do that *and* use the XML provider to read from app.config, or add the `System.Configuration.ConfigurationManager` package and use `app.config` as you already did – Panagiotis Kanavos Oct 22 '20 at 16:27
  • I have added System.Configuration.ConfigurationManager, but where should i put the app.config – Alazar Komar Oct 22 '20 at 16:41

0 Answers0