.NET Core 3 introduced a not-so-well-known configuration mechanism that still has some use: a runtime host configuration. The idea here is that you provide configuration settings, as key-value pairs, in the .csproj file. You can retrieve them programmatically from the AppContext class. Here is an example project file:
<ProjectSdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<RuntimeHostConfigurationOptionInclude="Foo"Value="Bar"/>
</ItemGroup>
</Project>
The "Foo" setting is retrievable through a call to the GetData method of the AppContext class, as illustrated in the following code snippet:
var bar = AppContext.GetData("Foo");
If the named entry does not exist, GetData just returns null. Mind you, GetData is prototyped as returning an object,...