Trên máy chủ sản xuất, tôi có thể thấy sự kiện này từ Trình xem sự kiện hệ thống khi ứng dụng ASP .NET bị treo :Ngoại lệ chưa xử lý khiến ứng dụng gặp sự cố với "EventType clr20r3, P1 w3wp.exe" trong nhật ký, nhưng không có chi tiết nào tại
eventType clr20r3, P1 w3wp.exe, P2 6.0.3790.3959, P3 45d691cc,
P4 app_web_default.aspx.cdcab7d2, P5 0.0.0.0, P6 4b2e4bf0, P7 4, P8 4, P9
hệ thống .dividebyzeroexception, P10 NIL. *
Nó thuộc về ".NET Runtime 2 .0 Báo cáo lỗi "danh mục.
Nhưng tôi không thể tìm thấy một sự kiện mà thuộc về "ASP.NET 2.0.50727.0" danh mục có thể cho tôi ngoại lệ này một cái nhìn chi tiết như thế này:
An unhandled exception occurred and the process was terminated.
Application ID: /LM/W3SVC/505951206/Root
Process ID: 1112
Exception: System.DivideByZeroException
Message: Attempted to divide by zero.
StackTrace:
at _Default.Foo(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp
Tôi có trường hợp thứ hai trên của tôi dev máy, là nó bởi vì Visual Studio được cài đặt ở đó? Nếu vậy, làm thế nào tôi có thể vô hiệu hóa điều này để tôi có thể mô phỏng môi trường sản xuất?
Đây là cực kỳ hữu ích, tôi đã có một tấn khó khăn khi tìm thông tin này trong Google. Cảm ơn! –
@DanielBahmani: Cảm ơn Daniel đã cung cấp thông tin có giá trị. 1 cho câu trả lời tuyệt vời. –
@DanielB vâng, xin lỗi vì sự khởi đầu muộn –