Problem with printing a DYMO label SkiaSharp.Views.Desktop Error

145 Views Asked by At

Good morning I have a problem with printing a DYMO label. I tried to print with the example tutorial on the DYMO Blog but it always gives me this error:

$exception {"Could not load file or assembly 'SkiaSharp.Views.Desktop, Version=1.68.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. The specified assembly manifest definition does not match the assembly reference. ( Exception from HRESULT: 0x80131040)":"SkiaSharp.Views.Desktop, Version=1.68.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"} System.IO.FileLoadException

I have Visual Studio community 2022 with .NET framework 4.8. Please can someone help me? A thousand thanks

I also add the module in VB.NET which exactly matches the tutorial.

Imports DymoSDK.Implementations
Imports System.IO.Path
Imports DymoSDK
Imports OpenTK
Module Module1

    Sub Main()
        DymoSDK.App.Init()

        Dim fullpath As String = System.IO.Path.GetFullPath("C:\Users\fabri\source\repos\VB_DYMOSDK_Sample\VB_DYMOSDK_Sample\ProvaEtichetta.dymo")
        Dim dymoSDKLabel = DymoLabel.Instance
        dymoSDKLabel.LoadLabelFromFilePath(fullpath)

        Dim dymoSDKPrinter = DymoPrinter.Instance

        Dim Printers = DymoPrinter.Instance.GetPrinters()
        Dim ConnectedPrinter = Printers.FirstOrDefault()

        For Each prt In Printers    ' Iterate through each element and find a connected printer.  
            Console.WriteLine($"Printer info: {prt.DriverName}, {prt.Name}, {prt.IsTwinTurbo}")
            If prt.IsConnected Then
                ConnectedPrinter = prt
            End If
        Next

        If dymoSDKPrinter.PrintLabel(dymoSDKLabel, ConnectedPrinter.Name, 1, False, False, 0, False, False) Then
            Console.WriteLine("Print successful.")
        End If

        Console.ReadKey()

    End Sub

End Module
0

There are 0 best solutions below