I have public interface and internal impl,
public interface IService
{
...
}
internal class Service: IService
{
...
}
I registered them via
builder.RegisterAssemblyTypes(assembly)
.EnableInterfaceInterceptors()
.AsImplementedInterfaces()
.AsSelf()
But I'm getting error
The component Activator = Service (ReflectionActivator), Services = [~.IService, ~.Service], Lifetime = Autofac.Core.Lifetime.MatchingScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope cannot use interface interception as it provides services that are not publicly visible interfaces. Check your registration of the component to ensure you're not enabling interception and registering it as an internal/private interface type.
Why am I getting this error? My interface is public.