AutoFac.Core.DependencyResolutionException after following tutorial
Anyone know what might be causing this error?
builder.RegisterType<IDomainRepository>().As<IDomainRepository>();
^^
should be
builder.RegisterType<DomainRepository>().As<IDomainRepository>();
^
because you need to RegisterType
of the Concrete type, not the interface.
Autofac Registration Concepts
Excerpt:
Any component type you register via
RegisterType
must be a concrete type.