抛出FatalExecutionEngineError异常后,无法在visual studio 2015中设置下一个语句

时间:2017-12-15 12:31:59

标签: c# visual-studio nhibernate visual-studio-debugging callstack

我不熟悉使用visual studio及其调试功能,所以我伸出手来看看是否有人知道如何将我的程序解除为特定声明。

目前,当我尝试设置下一条语句时,我收到以下错误消息。或者展开调用堆栈:

Unable to set the next statement. The attempt to unwind the callstack failed.

Unwinding is not possible in the following scenarios:
1. Debugging was started via Just-In-Time debugging.
2. An unwind is in progress
3. A System.StackOverflowException or System.Threading.ThreadAbortException exception has been thrown.

对我来说,问题在于我没有重新启动程序的奢侈。对数据库进行了重要更改,我需要在完成时记录到电子表格。当我的程序到达语句11(下面)以保存文件时,我收到了OutOfMemoryException(是的,我现在意识到我应该定期登录而不是在结尾记录所有内容)。

在此之后OutOfMemoryException我能够返回到声明3.然后我关闭了我的nhibernate会话(通过visual studio'立即窗口'实用程序),释放了~2gb缓存内存。然后我跨过了每个语句,直到我再次点击语句11 - 希望有足够的内存可用于保存文件。这没有用,我得到了另一个OutOfMemoryException

我再次回到声明3并跨过它重新初始化我的excelDocument。下一步行动计划是单独保存每个Excel工作表,而不是将它们全部附加到同一文档。这将涉及(1)重新初始化excelDocument,(2)手动添加一个工作表,(3)保存该文档,(4)并对每个表重复(总共6个)。我尝试在即时窗口中执行此操作。实用程序,但它导致FatalExecutionEngineError。在此之后,我几乎无法解开callstack或设置下一个语句(当我尝试时得到上述错误)。我能做些什么来解决这个问题吗?让我回到声明3,这样我就可以找到记录这些数据的解决方案吗?

01   public static void DataTablesToExcel(List<DataTable> tables, string path)
02   {
03       XLWorkbook excelDocument = new XLWorkbook();
04
05       foreach (DataTable table in tables)
06       {
07           excelDocument.AddWorksheet(table);
09       }
10
11       excelDocument.SaveAs(path);
12   }
PS:如果有任何帮助,当我全部打破时,&#39;好像程序停留在声明5上。当我走过去的时候。那句话,没有任何反应。好像程序不能再继续执行了。如果需要更多信息,请不要犹豫,问我。

0 个答案:

没有答案
相关问题