How can you use a console config file (App.config) in a .NET Standard project.
I have one console application with in the App.config:
<appSettings>
<add key="Test" value="test" />
</appSettings>
In my .NET Standard project I added the NuGet package:
Install-Package System.Configuration.ConfigurationManager -Version 4.5.0
And have a class that returns the value of that Key:
public string Test()
{
return ConfigurationManager.AppSettings["Test"];
}
This is just to test if I could use App.config settings in a .NET Standard project.
But I get this error message:
System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'
When I do this in Program.cs:
Class class = new Class();
string result = class.Test();