I have a C# console program that prints an App.config value. Can I override this value from an environment variable?
Example App.config:
<appSettings>
<add key="TestKey" value="Foo"/>
</appSettings>
Example Code:
Console.WriteLine($"Key: {ConfigurationManager.AppSettings["TestKey"]}");
I tried just setting the Key name but that obviously doesn't work:
C:\> set TestKey=Bar
C:\> ConsoleApp2.exe
Key: Foo