COMException: Retrieving the COM class factory for component with CLSID failed due to the following error: 80080005 Follow



I'm updating an application after we upgraded to Bartender 2019.  We are using the 32bit version and I believe it is an Automation Edition.  I have a library that uses the Seagull.BarTender.Print reference.  I get the following execption when it tries to create the Engine.  I've tried changing the Platform of the library from AnyCPU to x86 and I've manually registered the Bartend.exe.  I'm using Visual Studio 2019 and running on a Windows 10 64bit computer.

using (Engine printEngine = new Engine(true))

Message=The BarTender engine could not be started. Possible reasons are:

1) BarTender is not properly installed.
2) BarTender is not properly registered on the computer (e.g bartend.exe /register).
3) There are too many process instances of BarTender running. Stop a few bartend.exe instances and try again. Also see SDK Engine.Start method documentation for information about how to allow more BarTender processes to run on your computer by increasing your "non-interactive" shared desktop heap.
4) The user account does not have permission to run BarTender.

at Seagull.BarTender.Print.Engine.Start(EngineSettings engineSettings, LicenseKeyManaged license, IntPtr interactiveUserHandle)
at Seagull.BarTender.Print.Engine.Start()
at Seagull.BarTender.Print.Engine..ctor(Boolean startEngine)
at AutoHarvest.LabelPrintLib.PrintKioskLabels.RunPrintJob(String printJobName, Int32 waitForCompletionTimeout, KioskLabelDataModel kioskDataModel) in C:\Repos\TigerApps\dotNet\Interfaces\AutoHarvest\AutoHarvest.LabelPrintLib\PrintKioskLabels.cs:line 26

This exception was originally thrown at this call stack:
[External Code]

Inner Exception 1:
COMException: Retrieving the COM class factory for component with CLSID {B9425246-4131-11D2-BE48-004005A04EDF} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).




Bill Gauvey
Comment actions Permalink

With that, I'd say uninstall / reboot / reinstall.  80080005 error is Access Denied. You can look in Component services and look at DCOM configuration and make sure Everyone has launch and activate permissions, but a clean reinstall may be the best measure.  This issue should be local to just your machine, you can verify by launching the app on a different machine

David Logan
Comment actions Permalink

So the problem was the BarTender.exe was left hanging open here and multiple instances were running in the background.  Once I cleared those this error went away.  I also updated the reference in the .net application to the current library ... I'm not 100% sure if that had any bearing on the situation but thought I'd include it here.  I then had issues with the Print function not returning for 2 minutes even though the timeout parameter is set to 5000 which should be 5 seconds.  

Do you have any thoughts on that or should I open a new ticket.  In this instance the printer was turned off but it took a long time to figure out I needed to just wait those 2 minutes for the debugger to return to me.  From what I can tell the parameter has no effect.  I've tried values of 10, 30, 1000, 5000 it still takes 2+ minutes for the LabelFormatDocument.Print function to return.  I am using the last version that takes the timeout value and messages object as parameters.

David Logan
Comment actions Permalink

Just to add to the above comments if it helps anybody ... it did turn out to be somekind of install issue.  I tried printing the label through the designer and had similar performance issues ... so I uninstalled and reinstalled and things are working as expected now.


Please sign in to leave a comment.