First, it is needed to register an open generic type LogConfig<>
as @Marwijn did.
Then, you can register all BaseSettings<T>
implementations by means of selecting base type/condition and service for the component using BasedOn(typeof(BaseSettings<>))
and WithService.Base()
.
The following test method proves it:
[TestMethod]
public void resolve_generics()
{
// arrange
var container = new WindsorContainer();
container.Register(
Component.For(typeof(LogConfig<>)),
Classes.FromThisAssembly().BasedOn(typeof(BaseSettings<>)).WithService.Base());
//act
var otherSettings = container.Resolve<LogConfig<OtherSettings>>();
var addinSettings = container.Resolve<LogConfig<AddinSettings>>();
// assert
otherSettings.Should().NotBeNull();
otherSettings.Client.Should().BeOfType<OtherSettings>();
addinSettings.Should().NotBeNull();
addinSettings.Client.Should().BeOfType<AddinSettings>();
}
There is another answer on the similar question about registering types based on base class.