I have a .net framework class library project which is absolutely working fine with the .net framework projects, Now I need to refer it in .net core application also. so I am trying to create a new .net standard project and copied all the .cs files to this project from the existing project. and started fixing the compilation errors. I have fixed many but still getting a few.
string applicationName = System.Configuration.ConfigurationManager.AppSettings["Application"];
On the above line, it's giving the below error.
type or namespace name 'ConfigurationManager' does not exist in the namespace 'System.Configuration'
Tried so far:
- I have added the package
System.Configuration.ConfigurationManager
from Nuget - Tried adding
System.Configuration.dll
from Reference Manager but it shows nothing forSystem.Configuration.dll
How to solve this issue in the .net standard class library? Or is it not supported at all?
In another way, question can be how to read appsettings.json file in .net standard class library?
I solved the issue by adding
Microsoft.Extensions.Configuration
to the project from the NuGet package manager.