G
Guest
Is it possible to instantiate a generic class when the parametrized type
isn't known until runtime? For example, in Indigo you can deploy a web
service with something like...
ServiceHost<Foo> sh = new ServiceHost<Foo>(myURI);
sh.Open();
What if the type "Foo" isn't known until runtime? Can I use reflection to
create a Type object corresponding to the type ServiceHost<Foo>, then use
Activator.CreateInstance()? How would I do this? Do I use
System.Reflection.Emit.GenericTypeParameterBuilder?
Thanks,
-- Jim Robertson
isn't known until runtime? For example, in Indigo you can deploy a web
service with something like...
ServiceHost<Foo> sh = new ServiceHost<Foo>(myURI);
sh.Open();
What if the type "Foo" isn't known until runtime? Can I use reflection to
create a Type object corresponding to the type ServiceHost<Foo>, then use
Activator.CreateInstance()? How would I do this? Do I use
System.Reflection.Emit.GenericTypeParameterBuilder?
Thanks,
-- Jim Robertson