I have written an console application that would backup some ComApplications properties using the methods available in ComAdmin.dll.
So, i have added a reference of this dll to my console application. So, this would require the dll at runtime too (i.e. while the exe is running). But, i dont want to copy this dll all time with the console exe.
So, i just thought of using DllImport to import all the required methods and start using them in my console application. But, i get this "PInvoke restriction: cannot return variants." . I understand this is an restriction and i would like to know, do we
have any ways to overcome this.
Is this possible to achieve my goal using DllImport with any workarounds ?
I tried to explore the ComAdmin.dll in reflector and copy the classes and Interface code into my console application - with this, i was able to execute the first two line successfully.
COMAdminCatalog comAdminobj = new COMAdminCatalog();
COMAdminCatalogCollection collection = ((COMAdminCatalogCollection)comAdminobj.GetCollection("Applications"));
But, it failed with system invalidoperationexception while populating the collection, without much information. Has anyone come acro
View Complete Post