簡體   English   中英

Visual Studio 2010在網站上超時的速度過快

[英]Visual Studio 2010 is timing out way too quickly on a website

設置斷點並嘗試單步執行網站代碼后,調試器似乎僅在幾秒鍾內“超時”並停止調試。 我不知道是什么原因造成的,這讓我發瘋。

這是我嘗試逐步執行的代碼:

 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();
        }

這很可能意味着由於未處理的異常或在IIS中的應用程序池上設置了回收參數而重置了Web應用程序。

要做的第一件事是檢查Windows應用程序和系統事件日志,以查看是否報告了未處理的異常。

第二件事是檢查您的IIS應用程序池設置,以查看是否有可能滿足的短期回收限制。

是否由於應用程序已完成生命周期而停止調試?

我的猜測是您的斷點甚至沒有得到滿足,因為它們位於未執行的代碼中。 但是,如果沒有看到更多的代碼和細節(即斷點在哪里),那只是純粹的猜測。

您收到任何錯誤還是只是默默停止?

如果您的網站托管在IIS中,並且正在執行調試器附加。 我的猜測是應用程序池即將終止工作線程。

進入IIS,找到應用程序池/右鍵單擊“設置應用程序池默認值”。

Ping Enabled: false

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM