I am trying to register a cross-AppDomain proxy with Autofac.
The specific type represented by the proxy implements the IServiceHost interface. Therefore, the proxy server must also in order to allow proxy server calls using this interface.
I am trying to register a proxy with Autofac by doing:
void Initialize(IServiceHost host)
{
Host = host;
var builder = new ContainerBuilder();
builder.RegisterInstance(host)
.As<IServiceHost>()
.SingleInstance();
Scope = builder.Build();
}
However, in the call, builder.Build()I get:
ArgumentException
The type "System.MarshalByRefObject" is not assigned to the service "Treadmarks.Core.ServiceBase.IServiceHost".
However, host definitely a IServiceHost, since it is not null and refers to the argument of a strongly typed method.
Can someone explain how I can correctly register proxies?