You are currently viewing .NET Chained Configuration Demo

.NET Chained Configuration Demo

The way Microsoft’s chained configuration works can be confusing. This project demonstrates Microsoft’s chained configuration behavior for .NET generic host apps.

Using the demo, you can explore what configuration provider overrides another, in order, for the generic host builder for .NET 6.0.

The idea is a a property called “Greeting” that is passed in by various mechanisms. Each mechanism has its own value for the property.

To get started, find the code at Github.

~/source/repos/ChainedConfigurationDemo/pub  master
└─➤ cd ..; dotnet publish -o pub --nologo --verbosity quiet; cd pub

~/source/repos/ChainedConfigurationDemo/pub  master
└─➤ ./ChainedConfigurationDemo.exe Greeting=HelloFromArgs
Starting demo...

In the end, the greeting is "HelloFromAzure"

Press Ctrl-C to stop the host and exit.

Leave a Reply