【问题标题】:C# Application is in break modeC# 应用程序处于中断模式
【发布时间】:2023-03-15 08:11:01
【问题描述】:

我正在努力让我的应用程序退出中断模式,这就是发生的事情:

这是我的代码,一切正常:

Engine btEngine = new Engine();
btEngine.Start();
LabelFormatDocument SerialPlate = btEngine.Documents.Open(@"C:\Afrisoft\Labels\ItemLabel_General.btw");
LabelFormatDocument BoxLabel = btEngine.Documents.Open(@"C:\Afrisoft\Labels\BoxLabel_General.btw");
SerialPlate.DatabaseConnections.QueryPrompts["JobNumber"].Value = textBox1.Text.Trim();
BoxLabel.DatabaseConnections.QueryPrompts["JobNumber"].Value = textBox1.Text.Trim();
Result SerialPlateResult = SerialPlate.Print();
Result BoxLabelResult = BoxLabel.Print();
btEngine.Stop();

然后我按照文档建议将其更改为以下内容:

using (Engine btEngine = new Engine(true))
{
    LabelFormatDocument SerialPlate = btEngine.Documents.Open(@"C:\Afrisoft\Labels\ItemLabel_General.btw");
    LabelFormatDocument BoxLabel = btEngine.Documents.Open(@"C:\Afrisoft\Labels\BoxLabel_General.btw");
    SerialPlate.DatabaseConnections.QueryPrompts["JobNumber"].Value = textBox1.Text.Trim();
    BoxLabel.DatabaseConnections.QueryPrompts["JobNumber"].Value = textBox1.Text.Trim();
    Result SerialPlateResult = SerialPlate.Print();
    Result BoxLabelResult = BoxLabel.Print();

我在以下位置插入了一个断点:

using (Engine btEngine = new Engine(true))

然后,当我将断点移开以测试该部分时,应用程序也一直在该点崩溃。我重新添加了参考,将代码改回了它工作时的状态,但没有任何修复。

请帮忙。

【问题讨论】:

  • 尝试在nuget pacakge manager中更新seagull
  • 你确定代码被重新编译了吗?右键单击资源管理器窗口中的项目并选择“重建解决方案”。
  • 您是否尝试过验证是否存在或将引用的类库复制到应用程序的执行路径?
  • 看起来像一个 nuget 包问题。尝试执行以下操作: 1) update-package -reinstall 在 nuget 包管理器控制台下 2) 删除目标项目中的 obj 和 bin 文件夹 3) 最重要的是重建项目 - 确保此 nuget 包安装在入口点项目中(比如说 - 运行此代码的控制台应用程序项目)
  • dll 来自 bartender 的安装文件夹,当引用 dll 时,它会将该 dll 和一个 xml 文件复制到执行路径。我删除了 bin 文件夹中的所有内容并重建项目,但仍然发生同样的事情。

标签: c# visual-studio-2017 bartender


【解决方案1】:

好像库坏了,重新安装解决了问题

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多