ExLibrisGroup / SpineOMatic

Spine label printing for Ex Libris' Alma
MIT License
36 stars 18 forks source link

Unhandled exception 8.1.3 #71

Closed alainaecon closed 2 months ago

alainaecon commented 2 months ago

We are getting the same error message as Issue #70, even after installing 8.1.3. I have included a screenshot of the error message. Screenshot 2024-08-27 113417

mgobat commented 2 months ago

@alainaecon, please click the "Details" button and provide a screenshot of what is displayed. Thanks.

khart20 commented 2 months ago

Note that 8.1.2 is working on our Windows 10 PCs, but this error is showing on our Windows 11 PCs. We tried 8.1.3, but the error remains.

mgobat commented 2 months ago

@alainaecon, @khart20. Is this happening with batch print preview as reported in issue #70, or is it a different workflow? Thanks.

khart20 commented 2 months ago

@mgobat We do not use batch print. This is when we scan a single barcode and the XML is returned, as we can see it in the Current XML tab, but this error pops up and if we continue it does not process the XML into the preview.

alainaecon commented 2 months ago

This is the message under "details". I copied and pasted the message instead of screenshots due to its length. :

See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.

** Exception Text ** System.ArgumentException: Argument 'Length' must be greater or equal to zero. at Microsoft.VisualBasic.Strings.Mid(String str, Int32 Start, Int32 Length) at SpineLabeler.Form1.aboveCall(String libname, String liblocation) at SpineLabeler.Form1.printCallNum() at SpineLabeler.Form1.getBarcodeFile() at SpineLabeler.Form1.callAlma() at SpineLabeler.Form1.InputBox_KeyPress(Object sender, KeyPressEventArgs e) at System.Windows.Forms.Control.OnKeyPress(KeyPressEventArgs e) at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m) at System.Windows.Forms.Control.WmKeyChar(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.TextBoxBase.WndProc(Message& m) at System.Windows.Forms.TextBox.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

** Loaded Assemblies ** mscorlib Assembly Version: 4.0.0.0 Win32 Version: 4.8.9261.0 built by: NET481REL1LAST_C CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll

SpineLabeler Assembly Version: 8.1.3.0 Win32 Version: 8.1.3.0 CodeBase: file:///C:/Spine-O-Matic%208.1.3/SpineLabeler.exe

Microsoft.VisualBasic Assembly Version: 10.0.0.0 Win32 Version: 14.8.9032.0 built by: NET481REL1 CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll

System

mgobat commented 2 months ago

@alainaecon, @khart20. So that I understand all circumstances with the problem, let me summarize.

Please confirm I have the problem steps correct. If I do, please copy the XML from the "Current XML" tab (make sure the "include settings" checkbox is checked) after you have scanned in the barcode and gotten the "unhandled exception" error, and paste it into a text file. Please remove the restfulapikey entry in the XML before posting here. You can then add the file to a comment by dragging/dropping the file.

Thank you.

alainaecon commented 2 months ago

Let me know if you need any more information, thank you so much!

khart20 commented 2 months ago

If it helps. Here is a comparison/diff view of that XML output between 8.1.3 and our working 8.1.2 for same item barcode.

Diff813to812
mgobat commented 2 months ago

@alainaecon, @khart20, thank you for the additional information.

I should have thought of this yesterday. Starting with version 8.0.0 of SpineOMatic, version 4.8 of the .Net Framework is required. I'm not sure which version is the default for Windows 11. Please check if version 4.8 is installed, and if not, install it from this link. If that solves the problem, great!

If that doesn't solve the problem, the only thing I see in the xml you provided is possibly the different label printer on the Windows 11 computer. Does your Windows 11 computer have the "Microsoft Print to PDF" driver? If yes, could you try selecting it as your printer on the "Print Setup" tab, scan in the barcode, and click the "Send to desktop printer" button to see if you get the same "Unhandled exception" error? Clicking the "Send to desktop printer button" with the "Microsoft Print to PDF" printer should result in a "Save Print Output As" dialog box. Enter a "File name", click "Save", then look at the resulting PDF file to see if the label looks correct. If that works, then there may be some issue with SpineOMatic and the label printer attached to your Windows 11 computer.

Thanks.

alainaecon commented 2 months ago

The Windows 11 computer has version 4.8 of the .Net Framework. I uninstalled and reinstalled "Microsoft Print to PDF", then changed the printer in SpineOMatic, and I still get the same error message as before when I scan a barcode.

mgobat commented 2 months ago

Thanks for running that test, @alainaecon.

mgobat commented 2 months ago

@alainaecon, @khart20, I'm trying to isolate where the problem may be in the code. Based on what I'm seeing, I'm assuming you have label prefixes defined on the "Label Prefixes" tab. If that is correct, can you confirm that the problem does not happen if you delete the label prefixes defined on the "Label Prefixes" tab? If the problem does not still occur, then try recreating your label prefixes and test again.

alainaecon commented 2 months ago

We isolated our label prefixes and were able to discover the issue! We are undergoing a library renovation and had to create some new label prefixes for our temporary location, and there was an error in one of those prefixes. Ultimately has nothing to do with Windows 11, just a coincidence that the Windows 10 computer did not have those new label prefixes added yet.

Thank you so much for your help in resolving this!

mgobat commented 2 months ago

That's great, @alainaecon. Sorry I didn't think of that first.

khart20 commented 2 months ago

@mgobat Mark Thank you for your help!