dymosoftware/DCD-SDK-Sample

"The given key 'DYMO.LabelAPI.Interfaces.IDYMOBrush' was not present in the dictionary."

Opened this issue · 2 comments

Hi I see that someone else posted on this issue: as was posted back in Spring:

While loading a *.dymo label file I got the following exception:

An unhandled exception of type 'System.Collections.Generic.KeyNotFoundException' occurred in System.Private.CoreLib.dll
The given key 'DYMO.LabelAPI.Interfaces.IDYMOBrush' was not present in the dictionary.

IDymoLabel l = DymoLabel.Instance;
l.LoadLabelFromFilePath("C:\ ....\myLabel.dymo");

.NET CORE 6 project (C#)
DYMO.Connect.SDK 1.4.3.37
SkaiSharp 1.68.0

*.dymo label file was created with DYMO Connect 1.4.3.131

I'm having the exact same issue. This seems like something is ill-defined in the xml reading method in the api, something to do with the input of the tags. If I remove the tag, then the read fails because it seems to be expecting the brush tag. I don't think this has anything to do with SkiaSharp since those routines are not being called explicitly in the loadfromfile method.
Any workaround would be appreciated.

Here is the minimal label file I'm trying to read:

Blank.dymo.txt

Updates:

I updated to SkiaSharp 2.88.3 and this had no effect.
I copied in the entire label file as a string constant and used "LoadLabelFromXML" instead of from file and the very same error occurred:
An unhandled exception of type 'System.Collections.Generic.KeyNotFoundException' occurred in System.Private.CoreLib.dll
The given key 'DYMO.LabelAPI.Interfaces.IDYMOBrush' was not present in the dictionary.

This does suggest an error in the xml tag dictionary. IDYMOBrush is not well defined. Since Dymo Connect 1.4.3.131 can read and write these files, this suggests that the api is the problem.
Please help.
Thanks.

Check you're calling DymoSDK.App.Init() before LoadLabelFromXML - this looks to be a new requirement that snuck in; it's mentioned in the README but I'd got away without it until recent versions of the SDK. Much head scratching...