卡西卡的小寶庫
寶庫寶庫寶庫
Showing posts with label 錯誤處理. Show all posts
Showing posts with label 錯誤處理. Show all posts

客戶今天在MS更新後,原本正常的ASP.NET網站整個不能用,在事件檢視器裡有1007和1084的記錄。

http://support.microsoft.com/kb/835387/zh-tw

MessageId = 1007
由於在組態檔的 processModel 區段中提供了無效的使用者名稱和 (或) 密碼,所以無法啟動 aspnet_wp.exe 程式。.

MessageId = 1084
無法啟動 aspnet_wp.exe。. 這項失敗的錯誤碼為 %1。. 當背景工作處理序帳戶具有權限來讀取 . NET Framework 檔案不足時, 會發生這個錯誤。 請確定 .NET Framework 安裝正確,而且安裝目錄上的 ACL 允許存取設定的帳戶。

在GOOGLE搜一下,經實際測試後,整理如下:

  1. 移除KB886903的更新(如果有的話)
  2. 編輯[C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG\machine.config]
    找到 <processModeluserName="machine" password="AutoGenerate" … />
    確定 userName是machine,password是AutoGenerate。
  3. 移除ASPNET的帳號
    執行 aspnet_regiis -i
    執行 iisreset

http://klcintw4.blogspot.com/2007/08/iis8000400510071084.html

 

解法:SqlCommand.CommandTimeout[msdn] 加大,預設為30(秒)。

錯誤:SQL執行的時間太長就會發生 System.Data.SqlClient.SqlException。

ex
{"已超過連接逾時的設定。在作業完成之前超過逾時等待的時間,或者是伺服器未回應。" }
    [System.Data.SqlClient.SqlException]: {System.Data.SqlClient.SqlException}
    System.Object: {System.Data.SqlClient.SqlException}
    _className: null
    _COMPlusExceptionCode: -532459699
    _exceptionMethod: <未定義的值>
    _exceptionMethodString: null
    _helpURL: null
    _HResult: -2146232060
    _innerException: { }
    _message: "系統錯誤。"
    _remoteStackIndex: 0
    _remoteStackTraceString: null
    _source: null
    _stackTrace: {System.Array}
    _stackTraceString: null
    _xcode: -532459699
    _xptrs: 0
    HelpLink: null
    HResult: -2146232060
    InnerException: { }
    Message: "已超過連接逾時的設定。在作業完成之前超過逾時等待的時間,或者是伺服器未回應。"
    Source: ".Net SqlClient Data Provider"
    StackTrace: "   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)\r\n   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)\r\n   at System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)\r\n   at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)\r\n   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)\r\n   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)\r\n   at Textar.Klchang.Helper.SqlClient.DbBroker.QueryDS(String cmdText, CommandType cmdType, IDataParameter[] parameters) in d:\\project\\mmde\\core\\sqlclient3\\dbbroker.cs:line 436\r\n   at mmde.core.db.clsRptZ.RptZ02(DateTime COURSE_DATE1, DateTime COURSE_DATE2, DateTime VIEW_DATE1, Date
Time VIEW_DATE2) in d:\\project\\mmde\\web\\core\\db\\clsrptz.cs:line 56\r\n   at mmde.admin.reports.RptZ02.BindData() in d:\\project\\mmde\\web\\admin\\reports\\rptz02.aspx.cs:line 50"
    TargetSite: {System.Reflection.RuntimeMethodInfo}

其它:調整 SqlConnection.ConnectionString[msdn] (Connect Timeout, Connection Timeout)參數無效!