Reputation: 961
Long story short, trying to build a 'Smoke Tester' application. I'd like to be able to dynamically be given "Hey, this COM assembly (guid, progid) should exist" and attempt to create the COM object via ProgId or guid.
I know how to [ComImport] classes, but instead I'm looking to do this programatically. Is this possible?
Upvotes: 0
Views: 410
Reputation: 887469
Call Activator.CreateInstance(Type.GetTypeFromProgID("progid"))
(or Type.GetTypeFromCLSID
).
Upvotes: 4