I'm working on an ASP.NET Core Web App (MVC). I try to read a configuration value from my Web.config file using the following code.
var myConfig = ConfigurationManager.AppSettings["myConfig"];
My Web.config file looks like the following:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<compilation debug="true" />
<httpRuntime />
</system.web>
<appSettings>
<add key="myConfig" value="12345" />
</appSettings>
</configuration>
The output in the debugger shows the following:
Unfortunately, no value is returned. What am I doing wrong?
Thanks a lot in advance!