I've following code:
public class TestClass
{
public string Foo { get; set; }
public ITest<string> Test { get; set; }
}
[Convertible]
public interface ITest<T>
{
T Param { get; set; }
}
[Convertible]
public class Test<T> : ITest<T>
{
public T Param { get; set; }
public string OtherParam { get; set; }
}
And I'd like to use it
WindsorContainer container = new WindsorContainer(new XmlInterpreter());
var t = container.Resolve<TestClass>();
I don't want use Fluent configuration but xml-configuration. Also I'd like to escape explicit registration of components for ITest. It's lloks like that it can be configured with only one component registration (TestClass) and all parameters can be provided in in <parameters> node. But currently I failed to create working configuration, it creates null TestClass object or TestClass with Test property set to null.
My configuration:
<component id="Service.Main"
type="ConsoleApplication1.TestClass"
lifestyle="transient">
<parameters>
<foo>foo string</foo>
<Test>
<Param>param string</Param>
<OtherParam>sdgsdfgdf</OtherParam>
</Test>
</parameters>
</component>
Maybe someone can advise right configuration? Thnx
So, I got sources for 3.2.0 version. Add simple console application and check different versions with debugging.
Here is working solution:
<component id="Service.Main"
type="ConsoleApplication1.TestClass"
lifestyle="transient">
<parameters>
<foo>foo string</foo>
<Test>
<parameters type="ConsoleApplication1.Test`1[[System.String, mscorlib]], ConsoleApplication1">
<Param>param string</Param>
<OtherParam>sdgsdfgdf</OtherParam>
</parameters>
</Test>
</parameters>
</component>
Important notes:
Anyway configuration checked with 3.2.0 and it works.