I want to get a type from an unreferenced assembly. I used this answer to solve my problem.
The problem now is, that I’m loading the type ObjectList which contains another type from another assembly. I do it like this:
Assembly assembly = Assembly.LoadFrom ("@c:\myAssemblies\myAssembly.Data.DomainObjects.dll");
Type myType = assembly.GetType ("myAssembly.Data.DomainObjects.ObjectList`1[[myAssembly.otherNamespace.myClass, myAssembly.otherNamespace, Version=1.13.73.1082, Culture=neutral, PublicKeyToken=fee00910d6e5f53b]]");
The assembly with the otherNamespace is also not referenced and therefore the GetType method returns null. My question now is:
Is it possible to get the type of an object list which contains another type of an unreferenced assembly? Or: How can I load the assembly of a type within my ObjectList?
Ok, this is a little hard for me to test – but I hope my answer can be converted:
basically, you need to do it in two steps –
Here’s a Linqpad script: