[wix-users] COM Object exception

Alex Tuppen alex.tuppen at gmail.com
Tue Feb 21 08:37:54 PST 2017


Hi,

I was wondering if there is anything that I need to do to be able to use a
COM object from within a custom bootstrapper. I have the same COM object
working outside the bootstrapper but no matter what I try it always throws
an exception when the bootstrapper tries to use it.

The COM object in question is for the Microsoft Monitoring Agent and is
registered when the MMA is installed. I am attempting to use it with the
following code:

        public async Task<string> ConfigureOMSAgent()
        {
            return await Task.Run(() =>
            {
                try
                {
                    // Load COM object
                    Bootstrapper.Engine.Log(LogLevel.Verbose, "Loading
ManagementServiceConfiguration COM object");
                    AgentConfigManagerLib.ManagementServiceConfiguration
mgmntSrvCnfg = new AgentConfigManagerLib.ManagementServiceConfiguration();
                    // Configuring MMA as OMS agent
                    Bootstrapper.Engine.Log(LogLevel.Verbose, "Configuring
MMA as OMS agent");
                    mgmntSrvCnfg.AddCloudWorkspace(WorkSpaceID,
WorkSpaceKey);
                    // Return empty string indicating success
                    return string.Empty;
                }
                catch (Exception e)
                {
                    ErrorThrown(e.Message);
                    return e.Message;
                }
            });
        }

Any help will be amazing!

Thank you,

Alex


More information about the wix-users mailing list