1

I need load a JSON file with Autofac (IoC), and I'm following the official tutorial: http://autofaccn.readthedocs.io/en/latest/configuration/xml.html#quick-start

All the code is correct, but the ConfigurationModule class is not recognized:

var builder = new ContainerBuilder();

var config = new ConfigurationBuilder();
config.AddJsonFile("appsettings.json");
var module = new ConfigurationModule(config.Build());

builder.RegisterModule(module);
Jhon Duck
  • 357
  • 4
  • 14

1 Answers1

0

Add the NuGet package Autofac.Configuration

Arthur Attout
  • 2,701
  • 2
  • 26
  • 49
  • Awesome, works! But it has dependencies with .NET Framework, Version = 4.5... Is there some version only for .NET Standard? – Jhon Duck May 03 '18 at 08:58
  • I'm not super familiar with that kind of dependencies issues, but I've just created a new .NET standard project, and added Autofac.Configuration, which worked with no errors – Arthur Attout May 03 '18 at 09:40
  • In Windows, .NET Standard has tricks. Anyway, I accept the answer. – Jhon Duck May 03 '18 at 09:54