Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# App fails on a particular user but works on other systems #80

Open
booktrakker opened this issue Dec 15, 2023 · 5 comments
Open

C# App fails on a particular user but works on other systems #80

booktrakker opened this issue Dec 15, 2023 · 5 comments

Comments

@booktrakker
Copy link

I am running into an issue with the C#/.NET SDK where the call to open a Label Definition file works on most machines but fails on one system for a particular user.

Testing on other systems works, the label prints fine. I get an error when I try to load the Label Definition using this call:

label = DYMO.Label.Framework.Label.Open(labelFile);

This call works on most systems but fails on this system, with the following error (below). I added code to open the file and print the contents to my error log if this call fails, and I get the contents of the Label Definition file as shown beneath the error below. I also provided the label definition file in a zip file attached to this post.

I need to understand why the call to open the label is failing. I checked permissions on the folder, the fact that the error handler can open and report the contents of the file confirms that this is not a Permissions or Folder Security issue.

How do I get the SDK to properly read this label file so the user can print?

Please advise.

InnerException: There is an error in XML document (10, 4).
StackTrace: at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at System.Xml.Serialization.XmlSerializer.Deserialize(Stream stream)
at DYMO.Common.XMLSerializationHelpers.Deserialize[T](Stream mStream)
at DYMO.DLS.Runtime.Label.Load(Stream stream, Boolean wrapException)
at DYMO.DLS.Runtime.Label.Load(XmlDocument doc, Stream responseStream)
at DYMO.DLS.Runtime.Label.Load(String uri, IWebProxy webProxy)
InnerException: There is an error in XML document (10, 4).
StackTrace: at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at DYMO.DLS.Runtime.DieCutLabel.ReadXml(XmlReader reader)
at System.Xml.Serialization.XmlSerializationReader.ReadSerializable(IXmlSerializable serializable, Boolean wrappedAny)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderDieCutLabel.Read1_DieCutLabel()
InnerException: There is an error in XML document (10, 4).
StackTrace: at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at DYMO.DLS.Runtime.DieCutLabel.ObjectInfo.ReadXml(XmlReader reader)
at System.Xml.Serialization.XmlSerializationReader.ReadSerializable(IXmlSerializable serializable, Boolean wrappedAny)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderObjectInfo.Read1_ObjectInfo()
InnerException: Exception has been thrown by the target of an invocation.
DymoBookLandscape.zip

StackTrace: at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderAddressObject.Read10_AddressObject(Boolean isNullable, Boolean checkType)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderAddressObject.Read11_AddressObject()
InnerException: Could not load file or assembly 'MDYMOBarcode.dll' or one of its dependencies. The specified module could not be found.
StackTrace: at DYMO.DLS.Runtime.BarcodeLib..ctor()
at DYMO.DLS.Runtime.BarcodeRenderer..ctor(BarcodeType type, String text, BarcodeSize barcodeSize, HumanReadablePosition hrtPosition, Int32 ecLevel)
at DYMO.DLS.Runtime.AddressObject..ctor()
Unable to load label template 'C:\BTPro\Labels\DymoBookLandscape.label'
at DYMO.DLS.Runtime.Label.Load(String uri, IWebProxy webProxy)
at DYMO.Label.Framework.Label.Open(String uri)
at LabelPrinter.DymoLabel.Print() in G:\Ubix\LabelPrinter\DymoLabel.cs:line 331


Contents of the Label Definition file as reported in the Log (there is content from the logging function in here, the file itself is correct and works on other systems)

Opening Label Template File C:\BTPro\Labels\DymoBookLandscape.label in Print Method of DymoLabel

BTLabelPrinter 1.0.46.0 12-15-2023 10:35
Attempted to open Label File C:\BTPro\Labels\DymoBookLandscape.label:

Landscape Small30336 30336 1 in x 2-1/8 in StoreName Rotation0 False True Left Top ShrinkToFit True False StoreName False AboveAddress Price Rotation0 False True Left Top ShrinkToFit True False Price False AboveAddress AuthorTitle Rotation0 False True Left Top None True False Author/Title False AboveAddress Location Rotation0 False False Left Top ShrinkToFit True False Location Barcode Rotation0 False True 123456789123 Code128Auto Small Bottom None 0 Center InnerException Count: 5
@booktrakker
Copy link
Author

Hello! I really need some help. The issue seems to be that it cannot load the MDYMOBarcode.dll, which is in the folder and is the proper version, so it is not clear why it will not load. I tried to check dependencies but found none.

What do I need to do to get this working?

InnerException: Could not load file or assembly 'MDYMOBarcode.dll' or one of its dependencies. The specified module could not be found.

@booktrakker
Copy link
Author

Here is the full exception I get in my log:

InnerException: There is an error in XML document (10, 4).
StackTrace: at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at System.Xml.Serialization.XmlSerializer.Deserialize(Stream stream)
at DYMO.Common.XMLSerializationHelpers.Deserialize[T](Stream mStream)
at DYMO.DLS.Runtime.Label.Load(Stream stream, Boolean wrapException)
at DYMO.DLS.Runtime.Label.Load(XmlDocument doc, Stream responseStream)
at DYMO.DLS.Runtime.Label.Load(String uri, IWebProxy webProxy)
InnerException: There is an error in XML document (10, 4).
StackTrace: at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at DYMO.DLS.Runtime.DieCutLabel.ReadXml(XmlReader reader)
at System.Xml.Serialization.XmlSerializationReader.ReadSerializable(IXmlSerializable serializable, Boolean wrappedAny)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderDieCutLabel.Read1_DieCutLabel()
InnerException: There is an error in XML document (10, 4).
StackTrace: at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at DYMO.DLS.Runtime.DieCutLabel.ObjectInfo.ReadXml(XmlReader reader)
at System.Xml.Serialization.XmlSerializationReader.ReadSerializable(IXmlSerializable serializable, Boolean wrappedAny)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderObjectInfo.Read1_ObjectInfo()
InnerException: Exception has been thrown by the target of an invocation.
StackTrace: at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderAddressObject.Read10_AddressObject(Boolean isNullable, Boolean checkType)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderAddressObject.Read11_AddressObject()
InnerException: Could not load file or assembly 'MDYMOBarcode.dll' or one of its dependencies. The specified module could not be found.
StackTrace: at DYMO.DLS.Runtime.BarcodeLib..ctor()
at DYMO.DLS.Runtime.BarcodeRenderer..ctor(BarcodeType type, String text, BarcodeSize barcodeSize, HumanReadablePosition hrtPosition, Int32 ecLevel)
at DYMO.DLS.Runtime.AddressObject..ctor()
Unable to load label template 'C:\BTPro\Labels\DymoBookLandscape.label'
at DYMO.DLS.Runtime.Label.Load(String uri, IWebProxy webProxy)
at DYMO.Label.Framework.Label.Open(String uri)
at LabelPrinter.DymoLabel.Print() in G:\Ubix\LabelPrinter\DymoLabel.cs:line 331

@dymosoftware
Copy link
Owner

Hey @booktrakker, could you please check you have DYMO Label Software correctly installed on your PC? Since you are using DYMO Label Framework then you will need all the components from DLS installed.

@booktrakker
Copy link
Author

Hello,

We verified that they have the latest version of Dymo Label Framework installed. I have reproduced this issue on a system here, and it also has the full Dymo Label Framework installed. Nothing I do resolves the problem, and not knowing what the dependency issue relates to is hampering my efforts. What would cause the dll to fail to load, and what would cause the Report Load method to fail when there is no permission or security issue?

Please advise, the client is being very patient but needs a solution ASAP.

@booktrakker
Copy link
Author

With both Dymo Connect and the SDK installed this error is produced, indicating that it cannot read the Label Definition file, which I have code that opens and reads. Why can't the SDK open the file when my code can?

InnerException: There is an error in XML document (10, 4).
StackTrace: at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at System.Xml.Serialization.XmlSerializer.Deserialize(Stream stream)
at DYMO.Common.XMLSerializationHelpers.Deserialize[T](Stream mStream)
at DYMO.DLS.Runtime.Label.Load(Stream stream, Boolean wrapException)
at DYMO.DLS.Runtime.Label.Load(XmlDocument doc, Stream responseStream)
at DYMO.DLS.Runtime.Label.Load(String uri, IWebProxy webProxy)
InnerException: There is an error in XML document (10, 4).
StackTrace: at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at DYMO.DLS.Runtime.DieCutLabel.ReadXml(XmlReader reader)
at System.Xml.Serialization.XmlSerializationReader.ReadSerializable(IXmlSerializable serializable, Boolean wrappedAny)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderDieCutLabel.Read1_DieCutLabel()
InnerException: There is an error in XML document (10, 4).
StackTrace: at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at DYMO.DLS.Runtime.DieCutLabel.ObjectInfo.ReadXml(XmlReader reader)
at System.Xml.Serialization.XmlSerializationReader.ReadSerializable(IXmlSerializable serializable, Boolean wrappedAny)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderObjectInfo.Read1_ObjectInfo()
InnerException: Exception has been thrown by the target of an invocation.
StackTrace: at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderAddressObject.Read10_AddressObject(Boolean isNullable, Boolean checkType)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderAddressObject.Read11_AddressObject()
InnerException: Could not load file or assembly 'MDYMOBarcode.dll' or one of its dependencies. The specified module could not be found.
StackTrace: at DYMO.DLS.Runtime.BarcodeLib..ctor()
at DYMO.DLS.Runtime.BarcodeRenderer..ctor(BarcodeType type, String text, BarcodeSize barcodeSize, HumanReadablePosition hrtPosition, Int32 ecLevel)
at DYMO.DLS.Runtime.AddressObject..ctor()
Unable to load label template 'C:\BTPro\Labels\DymoBookLandscape.label'
at DYMO.DLS.Runtime.Label.Load(String uri, IWebProxy webProxy)
at DYMO.Label.Framework.Label.Open(String uri)
at LabelPrinter.DymoLabel.Print() in G:\Ubix\LabelPrinter\DymoLabel.cs:line 331

Here is what I see just prior to the above error when I try to read the same label definition file one line prior to the call to the SDK:

Attempted to open Label File C:\BTPro\Labels\DymoBookLandscape.label:

Landscape Small30336 30336 1 in x 2-1/8 in StoreName Rotation0 False True Left Top ShrinkToFit True False StoreName False AboveAddress Price Rotation0 False True Left Top ShrinkToFit True False Price False AboveAddress AuthorTitle Rotation0 False True Left Top None True False Author/Title False AboveAddress Location Rotation0 False False Left Top ShrinkToFit True False Location Barcode Rotation0 False True 123456789123 Code128Auto Small Bottom None 0 Center

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants