使用VS2008偵錯IIS7上的Web Application,程式中斷後,在你Line-By-Line埋首抓蟲之際,如果沒法在90秒內克敵制勝,IIS就會不耐久候,跳出以下訊息,偵錯過程跟著就中斷了。

The web server process that was being debugged has been terminated by Internet Information Services (IIS).  This can be avoided by configuring Application Pool ping settings in IIS.  See help for further details.

所幸IIS7雖然耐性不好,卻提供了明確的解決方案指引。按下Help按鈕,就會被引導到詳細的操作說明:

英文版: http://msdn.microsoft.com/en-us/library/bb763108.aspx
中文版: http://msdn.microsoft.com/zh-tw/library/bb763108.aspx

原來是在Debug期間,IIS會被監控機制(WAS)判定為無回應,一到了逾時上限(預設90秒),Worker Process就會被重啟。官方文件已詳細說明將Ping停用的步驟(不過大家覺得第10-12點跑去設定Terminal Service是在搞笑,根本是多餘的,請忽略之),這裡只補一下操作示意圖:

【注意】Ping功能可用來監測IIS Application Pool的狀態,偵測到無回應時會自動重啟Worker Process,有助於改善IIS穩定性,在正式運作的環境中,建議開啟。


Comments

Be the first to post a comment

Post a comment