I'm using .Net Standard 1.5 and want to read some values out of my config. However the following line
ConfigurationManager.AppSettings["Foo"]
gives me the following compile time error:
CS7069 Reference to type 'NameValueCollection' claims it is defined in 'System', but it could not be found
I thought that maybe in .Net Standard there is another way to read from AppSettings, but I haven't found anything on that topic.
ConfigurationManager.AppSettings
does under netstandard, in order to port a library from net35, so I opened a bounty on your question. – TurnoverSystem.ConfigurationManager
API and will support appsettings. For your users that support .NET Core you'll use the newerIOptions
approach. Then use compiler directives to support both. As an example, I've seen this approach in the AWS SDK for .NET. – Underthecounter