Generic Type names

(archived from my old blog from my pre-MS days)

The type name that you need to use in config files, such as for IoC containers, can be quite complex. For me, it's easier just to spike them than to try to remember the format gobbledy-gook.

public class GenericsTypeSpikes
    public void The_name_of_a_complex_type_can_be_found_in_Type_AssemblyQualifiedName()
        Type t = typeof(IList<ISource>);

        Assert.Equal("System.Collections.Generic.IList`1[[Blah.Core.ISource, Blah.Core, Version=, Culture=neutral, PublicKeyToken=null]], mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089", t.AssemblyQualifiedName);

Comments (0)

Skip to main content