tags:

views:

79

answers:

1

This is a simple issue of me not knowing proper Xml syntax. In castle windsor I can duplicate this line of code:

IoC.Container.AddComponent<IInputRequestedDialog<string>, SealsInputDialog>("seals");

With this Xml:

<component id="seals" 
    service="MyApp.InputRequestedDialog`1[[System.String]], MyApp" 
    type="MyApp.SealsInputDialog, MyApp" />

But what if the concrete generic is a string array rather than a string? How do I xml-ize the following?

IoC.Container.AddComponent<IInputRequestedDialog<string[]>, SealsInputDialog>("seals");
+2  A: 

Quoting Ken Egozi from the Castle Project Mailing list:


I just did

Console.WriteLine(typeof (IFoo<string[]>).FullName);

the output was:

IFoo`1[[System.String[], mscorlib, Version=2.0.0.0 , Culture=neutral, PublicKeyToken=b77a5c561934e089]]

so I guess

 service="MyApp.InputRequestedDialog`1[System.String[] ], MyApp"

should be working, and if not,

 service="MyApp.InputRequestedDialog`1[[System.String[], mscorlib, Version= 
2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], MyApp"


System.String[] works great, and I learned something about how to find out the proper Xml representation of a type too!

George Mauer
Upvoting an answer that quotes me feel strange :)
Ken Egozi