早上好 我在打印 DYMO 标签时遇到问题。我尝试使用 DYMO 博客上的示例教程进行打印,但它总是给我这个错误:
$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
我拥有带有 .NET Framework 4.8 的 Visual Studio 社区 2022。 请问有人可以帮助我吗? 一千个感谢
我还在 VB.NET 中添加了与教程完全匹配的模块。
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
我一直在 dymo Connect 上使用 wpf C#,但一直很头疼。
您是否使用了 Nuget for ConnectSDK?如果是这样,请检查依赖项的版本。 SkiaSharp 是必需的,并且还需要依赖它。
https://www.nuget.org/packages/DYMO.Connect.SDK/
这将为您提供依赖项。