COMAdminCatalogCollection.Populate throws error C#

1

I am using the COMAdminCatalog API for .net. I am currently getting certain properties of COM+ applications and components from an array of servers remotely. For the most part, my process doesn't have a problem retrieving this data. However, a few of the COM+ application's components will not populate and throws the following exception:

Error Message: Errors occurred accessing one or more objects - the ErrorInfo collection may have more detail (Exception from HRESULT: 0x80110401) I try getting the ErrorInfo collection, but no errorInfo objects are returned, so that doesn't help me in trouble shooting. Here is the documentation: https://msdn.microsoft.com/en-us/library/windows/desktop/ms686530(v=vs.85).aspx

Here is the method I am using to try to populate a component collection. Any help would be greatly appreciated. Thanks in advance

private static bool TryPopulateComponent(COMAdminCatalogCollection cOMAdminCatalogComponentCollection,
            COMAdminCatalogObject application = null, COMAdminCatalogObject component = null, string serverName = null)
        {
            try
            {
                cOMAdminCatalogComponentCollection.Populate();
                return true;
            }
            catch (Exception ex)
            {
                COMAdminCatalogCollection errorInfos = cOMAdminCatalogComponentCollection.GetCollection("ErrorInfo", varObjectKey: application.Key);
                errorInfos.Populate();
                foreach (COMAdminCatalogObject errorInfo in errorInfos)
                {
                    var errorCode = errorInfo.Value["ErrorCode"];
                    var majorRef = errorInfo.Value["MajorRef"];
                    var minorRef = errorInfo.Value["MinorRef"];
                    var name = errorInfo.Value["Name"]; 
                }

                COMException comException = new COMException(ex.Message, ex.InnerException,
                    application, component, serverName);
                Console.WriteLine($"Could not populate {component?.Name}");
                Console.WriteLine(ex.Message);
                LogTools.LogError(comException);
                return false;
            }
        }
c#
.net
com
com+
catalog
asked on Stack Overflow Jan 29, 2018 by Mattaceten

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0