Random .Net integration errors on btFormat.Print() 追蹤

Bryan Luisana


I have a .net based web application that calls bartender through the bartender SDK.  The application is heavily used across 3 physical plants by about 100 users.  About once every other week we start getting this error when trying to print a label using the SDK. 

Could not read key from registry (Exception from HRESULT: 0x80040150 (REGDB_E_READREGDB))

Stack Trace: at BarTender.QueryPromptsClass.GetQueryPrompt(Object Index) at Seagull.BarTender.Print.Database.QueryPrompts..ctor(QueryPrompts queryPrompts) at Seagull.BarTender.Print.Database.DatabaseConnections..ctor(Format format) at Seagull.BarTender.Print.LabelFormat..ctor(Format document, VisibleWindows visibleWindows) at Seagull.BarTender.Print.LabelFormatDocument..ctor(Format format, Engine engine) at Seagull.BarTender.Print.Documents.Open(String fileName, String printerName) at Seagull.BarTender.Print.Documents.Open(String fileName) at LabelsPortal.LabelData.BartenderProdPrint(List`1 labelParameters, String printername, ProductionPrint model, Boolean fulljob, Boolean preview, String username)

Once this error starts it occurs on all templates that are printed from all users, essentially shutting down all label printing.  To stop the error all you have to do is recycle the IIS app pool for the web application.  

I also found this error in the windows event log that seems to be the root of the issue. 

Windows detected your registry file is still in use by other applications or services. The file will be unloaded now. The applications or services that hold your registry file may not function properly afterwards. No user action is required.

3 user registry handles leaked from \Registry\User\S-1-5-21-2108716765-1479638596-1392588124-8395_Classes:
Process 1772 (\Device\HarddiskVolume2\Windows\SysWOW64\inetsrv\w3wp.exe) has opened key \REGISTRY\USER\S-1-5-21-2108716765-1479638596-1392588124-8395_CLASSES
Process 1772 (\Device\HarddiskVolume2\Windows\SysWOW64\inetsrv\w3wp.exe) has opened key \REGISTRY\USER\S-1-5-21-2108716765-1479638596-1392588124-8395_CLASSES
Process 1772 (\Device\HarddiskVolume2\Windows\SysWOW64\inetsrv\w3wp.exe) has opened key \REGISTRY\USER\S-1-5-21-2108716765-1479638596-1392588124-8395_CLASSES


Its interesting that the QueryPrompts method throws an error because we don't have queryprompts on any templates in the system.

How can I figure out what the root cause of this error is?