You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Add the configuration to the ConfigurationBuilder.
var config = new ConfigurationBuilder();
config.AddJsonFile("autofac.json");
// Register the ConfigurationModule with Autofac. _var module = new ConfigurationModule(config.Build());_
var builder = new ContainerBuilder();
builder.RegisterModule(module);
The config.Build() returns _IConfigurationRoot_ but ContainerBuilder requires _IConfiguration_ parameter.
Seems MS changed the API a little bit. Is there a way to create configuration from IConfiguraionRoot?
The text was updated successfully, but these errors were encountered:
Seems there is a problem with Microsoft.Extensions.Configuration (used by Autofac.Configuration) and the Documentation which states to use Microsoft.Framework.Configuration.
Just add Assemblies with Microsoft.Extensions.Configuration.* name instead of the former Microsoft.Framework.Configuration.* names to solve the Problem.
Anyway, I leave this open until the documentation is fixed.
The description about using ConfigurationModule does not work (does not even compile).
How to use ConfigurationModule as described here: http://autofac.readthedocs.org/en/latest/configuration/xml.html#quick-start does not work.
// Add the configuration to the ConfigurationBuilder.
var config = new ConfigurationBuilder();
config.AddJsonFile("autofac.json");
// Register the ConfigurationModule with Autofac.
_var module = new ConfigurationModule(config.Build());_
var builder = new ContainerBuilder();
builder.RegisterModule(module);
The config.Build() returns _IConfigurationRoot_ but ContainerBuilder requires _IConfiguration_ parameter.
Seems MS changed the API a little bit. Is there a way to create configuration from IConfiguraionRoot?
The text was updated successfully, but these errors were encountered: