0

我一直在开发一个非常简单的应用程序(或者我认为是这样)来打印一个带有简单条形码和一些文本的标签。我已经尽可能地遵循了文档,我认为它是模糊的,而不是描述性的。这是我的代码

 public void PrintLabel(string serial_num, string part_Num)
    {
        var label = DYMO.Label.Framework.Label.Open(AppDomain.CurrentDomain.BaseDirectory + "Barcode.label");
        label.SetObjectText("Bar_code", serial_num);
        label.SetObjectText("text_box", part_Num);
        label.Print("DYMO LabelWriter 450 Turbo");
    }

如您所见,这是我可以做的最简单的方法。我已将 包含DYMO.Label.Framework在标准参考中,并确保Barcode.label它位于基本目录中并且可以访问。当我点击具有导致 PrintLabel 的方法的按钮时,它会思考一秒钟,而打印机什么也不做。打印机堆栈中没有作业,我在输出日志中看不到任何奇怪的事情。(见下文)。

我究竟做错了什么?

“ProductValidationSoftware.vshost.exe”(CLR v4.0.30319:ProductValidationSoftware.vshost.exe):已加载“C:\Project Files\ProductValidationSoftware\ProductValidationSoftware\bin\Debug\ProductValidationSoftware.exe”。已加载符号。'ProductValidationSoftware.vshost.exe' (CLR v4.0.30319: ProductValidationSoftware.vshost.exe): 加载'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration .dll'。跳过加载符号。模块已优化,调试器选项“仅我的代码”已启用。'ProductValidationSoftware.vshost.exe' (CLR v4.0.30319: ProductValidationSoftware.vshost.exe): 加载'C:\Windows\Microsoft.Net\assembly\GAC_32\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transactions .dll'。跳过加载符号。模块已优化,调试器选项“仅我的代码”已启用。“ProductValidationSoftware.vshost.exe”(CLR v4.0.30319:ProductValidationSoftware.vshost.exe):已加载“C:\Windows\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices .dll'。跳过加载符号。模块已优化,调试器选项“仅我的代码”已启用。“ProductValidationSoftware.vshost.exe”(CLR v4.0.30319:ProductValidationSoftware.vshost.exe):已加载“C:\Windows\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices .Wrapper.dll'。跳过加载符号。模块已优化,调试器选项“仅我的代码”已启用。' ProductValidationSoftware.vshost.exe'(CLR v4.0.30319:ProductValidationSoftware.vshost.exe):加载了'C:\Project Files\ProductValidationSoftware\ProductValidationSoftware\bin\Debug\DYMO.Label.Framework.dll'。无法找到或打开 PDB 文件。“ProductValidationSoftware.vshost.exe”(CLR v4.0.30319:ProductValidationSoftware.vshost.exe):已加载“C:\Project Files\ProductValidationSoftware\ProductValidationSoftware\bin\Debug\DYMO.DLS.Runtime.dll”。无法找到或打开 PDB 文件。“ProductValidationSoftware.vshost.exe”(CLR v4.0.30319:ProductValidationSoftware.vshost.exe):已加载“C:\Project Files\ProductValidationSoftware\ProductValidationSoftware\bin\Debug\DYMO.Common.dll”。无法找到或打开 PDB 文件。'ProductValidationSoftware.vshost.exe' (CLR v4.0.30319: ProductValidationSoftware.vshost.exe):已加载“C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll”。跳过加载符号。模块已优化,调试器选项“仅我的代码”已启用。“ProductValidationSoftware.vshost.exe”(CLR v4.0.30319:ProductValidationSoftware.vshost.exe):已加载“C:\Windows\Microsoft.Net\assembly\GAC_32\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll”。跳过加载符号。模块已优化,调试器选项“仅我的代码”已启用。'ProductValidationSoftware.vshost.exe' (CLR v4.0.30319: ProductValidationSoftware.vshost.exe): 加载'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll' . 跳过加载符号。模块已优化,调试器选项“仅我的代码”已启用。'ProductValidationSoftware.vshost.exe' (CLR v4.0.30319: ProductValidationSoftware.vshost.exe): 加载'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xaml\v4.0_4.0.0.0__b77a5c561934e089\System.Xaml .dll'。跳过加载符号。模块已优化,调试器选项“仅我的代码”已启用。“ProductValidationSoftware.vshost.exe”(CLR v4.0.30319:ProductValidationSoftware.vshost.exe):已加载“C:\Project Files\ProductValidationSoftware\ProductValidationSoftware\bin\Debug\Interop.DYMOBarcodeLib.dll”。模块是在没有符号的情况下构建的。'ProductValidationSoftware.vshost.exe'(CLR v4.0.30319:ProductValidationSoftware.vshost.exe):加载'C:\Project Files\ProductValidationSoftware\ProductValidationSoftware\bin\Debug\Interop.DYMOPrintingSupportLib.dll'。模块是在没有符号的情况下构建的。ProductValidationSoftware.vshost.exe 信息:0:Utils.CreateLabelPrintParams():printParams == null,根据打印机类型“ProductValidationSoftware.vshost.exe”创建默认 printParams(CLR v4.0.30319:ProductValidationSoftware.vshost.exe):加载“C” :\Windows\Microsoft.Net\assembly\GAC_32\System.Printing\v4.0_4.0.0.0__31bf3856ad364e35\System.Printing.dll'。跳过加载符号。模块已优化,调试器选项“仅我的代码”已启用。“ProductValidationSoftware.vshost.exe”(CLR v4.0.30319:ProductValidationSoftware.vshost.exe):已加载“C:\Windows\Microsoft.Net\assembly\GAC_MSIL\ReachFramework\v4.0_4.0.0。0__31bf3856ad364e35\ReachFramework.dll'。跳过加载符号。模块已优化,调试器选项“仅我的代码”已启用。

4

1 回答 1

0

所以答案似乎很简单,更新电脑端的Dymo软件,确保只包含

使用 Dymo;

并且仅包含 DymoInterpolerate.dll 作为包含。

那时似乎工作正常。

不知道为什么会这样?

于 2016-02-20T10:12:18.730 回答