I have a WCF application where it is listening for a message. The EventHandler uses the ServiceClient which uses HttpClient to call another API.
The IoC class:
public static class IoC
{
public static IContainer Initialize()
{
ObjectFactory.Initialize(x =>
{
// Handlers
x.For<IHandle>().Use<EventHandler>();
// Service Clients
x.For<HttpClient>().Use<HttpClient>();
x.For<IServiceClient>().Use<ServiceClient>();
});
return ObjectFactory.Container;
}
}
I tried adding this after the Initialize but before the return:
ObjectFactory.Configure(x =>
{
x.Scan(scan =>
{
scan.LookForRegistries();
scan.Assembly("System.Net.Http");
});
});
But, I still get the exception in the title.