In Unity, is it possible to resolve a type from its type alias?
.net, c#, unity-container
Solution
No, aliases exist only in the XML configuration. i.e. they only exist at configuration type.
http://msdn.microsoft.com/en-us/library/ff660933(v=pandp.20).aspx details this
Aliases only exist at configuration time. They are not available at run time.
Problem
I've registered several types in Unity and given them type aliases as follows: ``` <typeAliases> <typeAlias alias="MyType" type="foo.bar.MyType, foo.bar" /> </typeAliases> ``` Is it possible to resolve these types by from the container using the aliased name (as opposed to by type), along the lines of: ``` var myType = container.ResolveByTypeAlias("MyType") ``` I can't see any way to do this, but wondered if I've missed something.