<p>Assuming I have only the class name of a generic as a string in the form of "MyCustomGenericCollection(of MyCustomObjectClass)" and don't know the assembly it comes from, what is the easiest way to create an instance of that object? </p>

<p>If it helps, I know that the class implements IMyCustomInterface and is from an assembly loaded into the current AppDomain.</p>

<p>Markus Olsson gave an excellent example <a href="https://stackoverflow.com/questions/31238/c-instantiating-classes-from-xml">here</a>, but I don't see how to apply it to generics.</p>

Once you parse it up, use
Type.GetType(string)
to get a reference to the types involved, then use
Type.MakeGenericType(Type[])
to construct the specific generic type you need.  Then, use
Type.GetConstructor(Type[])
to get a reference to a constructor for the specific generic type, and finally call
ConstructorInfo.Invoke
to get an instance of the object.
```
```
Type t1 = Type.GetType("MyCustomGenericCollection");
Type t2 = Type.GetType("MyCustomObjectClass");
Type t3 = t1.MakeGenericType(new Type[] { t2 });
ConstructorInfo ci = t3.GetConstructor(Type.EmptyTypes);
object obj = ci.Invoke(null);
```
```