I am trying to work with COM+ using c# and ASP.NET. I have been following an example, however part of it fails.
dynamic oCatalog = Activator.CreateInstance(Type.GetTypeFromProgID("ComAdmin.COMAdminCatalog"));
/* Get the Applications collection and populate it */
dynamic applicationInstances = oCatalog.GetCollection("Applications");
applicationInstances.Populate();
foreach (dynamic applicationInstance in applicationInstances)
{
Response.Write("<p>" + applicationInstance.Name.ToString() + "-" + applicationInstance.Key.ToString() + "</p>");
dynamic objComponents = oCatalog.GetCollection("Components", applicationInstance.Key);
objComponents.Populate();
foreach(dynamic Components in objComponents)
{
Response.Write("<p>" + Components.Name.ToString() + "</p>");
}
}
When the above call oCatalog.GetCollection("Components", applicationInstance.Key) is called I get the error:
System.Reflection.TargetParameterCountException: Error while invoking GetCollection.
How can I get a list of the current components in an application instance?