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,
If you don't mind translating to VB.NET, something like this should work
foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
{
// find the type of the item
Type itemType = assembly.GetType("MyCustomObjectClass", false);
// if we didnt find it, go to the next assembly
if (itemType == null)
{
continue;
}
// Now create a generic type for the collection
Type colType = assembly.GetType("MyCusomgGenericCollection").MakeGenericType(itemType);;
IMyCustomInterface result = (IMyCustomInterface)Activator.CreateInstance(colType);
break;
}