Type t = Type.GetTypeFromProgID("esriDataSourcesGDB.SdeWorkspaceFactory"); System.Object obj = Activator.CreateInstance(t); IWorkspaceFactory sdeWorkspaceFactory= obj as IWorkspaceFactory;
If you need to use an activator, why does Esri produce samples that do not use this method?
And why does it sometimes work? E.g. calling
IWorkspaceFactory workspaceFactory = new SdeWorkspaceFactory();
at 10.2 works for me, but at 10.0 it does not.
Also I can call new FileGDBWorkspaceFactoryClass() at 10.0, even though it is also a singleton.
here you can see why you need use activator: ArcObjects 10 .NET SDK Help