设置断点并尝试单步执行网站代码后,调试器似乎只在几秒钟内“超时”并停止调试。我不知道造成这种情况的原因是什么让我疯了。
以下是我试图介绍的代码:
using (System.Transactions.TransactionScope transaction = new System.Transactions.TransactionScope())
{
// Create new customer.
CustomersBLL customerOperations = new CustomersBLL();
customerOperations.InsertCustomer(quote.CurrentDate, null, null, null, null, null, null, null, null, null);
// Prepare to insert Quote.
// Retrieve CustomerID.
Table = customerOperations.GetNewestCustomerID();
quote.CustomerID = (int)Table.Rows[0][0];
// Get word count and quote amount.
quote.GetWordCount();
quote.GetQuoteAmount();
// Insert Quote
// Insert DocumentFile - must retrieve QuoteNumber.
transaction.Complete();
}
答案 0 :(得分:1)
这很可能意味着您的Web应用程序被重置,原因是未处理的异常或IIS中应用程序池上设置的回收参数。
首先要检查Windows应用程序和系统事件日志,看看是否报告了未处理的异常。
要做的第二件事是检查您的IIS应用程序池设置,看看是否有可能满足的短回收限制。
答案 1 :(得分:0)
是否因为应用程序已完成其生命周期而停止调试?
我的猜测是你的断点甚至都没有被满足,因为它们是在未执行的代码中。但是没有看到更多的代码和细节(即断点在哪里),那只是纯粹的猜测。
您是否收到任何错误,或者只是默默地停止?
答案 2 :(得分:0)
如果您的网站托管在IIS中,并且您正在执行调试程序附加。我的猜测是应用程序池正在使工作线程到期。
进入IIS,找到应用程序池/右键单击“设置应用程序池默认值”。
Ping Enabled: false