concept configuration file in category dependency injection

This is an excerpt from Manning's book Dependency Injection.
You can compose classes into an application in several ways. When we discussed late binding, we used a configuration file and a bit of dynamic object instantiation to manually compose the application from the available modules. We could also have used Configuration as Code using a DI Container. We’ll return to these in chapter 12.
Configuration files are as much a part of your Composition Root as is Configuration as Code and Auto-Registration. Using configuration files, therefore, doesn’t make your Composition Root smaller, it just moves it. Use configuration files only for those parts of your DI configuration that require late binding. Prefer Configuration as Code or Auto-Registration in all other parts of your configuration.
Listing 12.7 Reading configuration files using Autofac
var builder = new Autofac.ContainerBuilder(); #1 IConfigurationRoot configuration = #2 new ConfigurationBuilder() #2 .AddJsonFile("autofac.json") #2 .Build(); #2 builder.RegisterModule( #3 new Autofac.Configuration.ConfigurationModule( #3 configuration)); #3 #1 Allows adding mapping between Abstractions and concrete types #2 Loads the autofac.json configuration file from listing 12.6 using .NET Core’s configuration system #3 Wraps the created configuration in an Autofac module that processes the configuration file and maps the components to registrations in AutofacAutofac is the only DI Container included in this book that supports configuration files, but there are other DI Containers not covered here that continue to support configuration files. The exact schema is different for each container, but the overall structure tends to be similar, because you need to map an Abstraction to an implementation.