ASP.NET 黄屏死机 - 它从哪里获取堆栈跟踪?
我在我的应用程序中设置了一个远程处理类型,在其中我避免了 TargetInitationExceptions 并获取内部异常。我在 Exception
类上调用内部 PrepForRemoting
方法,以保留调用方法的堆栈跟踪。
这似乎正确构造了堆栈跟踪属性:
“\r\n服务器堆栈跟踪:\r\n
位于 ZBooking.Environment.Services.BookingService。<>c_DisplayClass9`1.b_5(BookingSlot p) 中 C:\dev\ZBookings\core\ZZBookings.Services\BookingService.cs:第 79 行\r\n
位于 System.Linq.Enumerable.All[TSource](IEnumerable'1 源,Func'2 谓词)\r\n
在 ZBookings.BookingService.MoveBooking[TBookingType](Int32 bookingId, >IEnumerable`1 bookingSlots) 中 C:\dev\ZBooking.Client\core\ZBookings.Services\BookingService.cs:第 79 行\r\n\r\n
在 [0] 处重新抛出异常:\r\n at ZBookings.BookingService。<>c_DisplayClass9`1.b_5(BookingSlot p) in C:\dev\ZBookings\core\ZBookings.Services\BookingService.cs:第 79 行\r\n
位于 System.Linq.Enumerable.All[TSource](IEnumerable'1 源,Func'2 谓词)\r\n
在 ZBookings.BookingService.MoveBooking[TBookingType](Int32 bookingId, IEnumerable`1 bookingSlots) 中 C:\dev\ZBookings\core\ZBookings.Services\BookingService.cs:第 79 行”
但是,当标准 ASP.NET 黄屏显示时,它是:
[NullReferenceException:未将对象引用设置为对象的实例。] C:\dev\ZBooking\core\ZBooking.ApplicationServices\MethodMarshaller.cs 中的 ZBooking.ApplicationServices.MethodMarshaller.Invoke(Delegate del, ZipIdentity zipIdentity, Object[] args):147 C:\dev\ZBooking\core\ZBooking.ApplicationServices\MethodMarshaller.cs 中的 ZBooking.ApplicationServices.MethodMarshaller.Invoke(Delegate del, ZipIdentity zipIdentity, Object[] args):105 C:\dev\ZBooking\core\ZBooking.ApplicationServices\MethodMarshaller.cs:72 中的 ZBooking.ApplicationServices.MethodMarshaller.Call(Func'3 del, T1 arg1, T2 arg2, ZipIdentity zipIdentity) ...等等
对 Global.asax 中的 Application_Error 调用 Server.GetLastError();
显示正确的堆栈跟踪。黄色屏幕堆栈跟踪来自哪里?
I have a remoting-type set up within my application where I avoid TargetInvocationExceptions
and grab the inner exception. I invoke the internal PrepForRemoting
method on the Exception
class to preserve the stack trace from the invoked method.
This appears to construct the stack trace property correctly:
"\r\nServer stack trace: \r\n
at ZBooking.Environment.Services.BookingService.<>c_DisplayClass9`1.b_5(BookingSlot p) in
C:\dev\ZBookings\core\ZZBookings.Services\BookingService.cs:line 79\r\nat System.Linq.Enumerable.All[TSource](IEnumerable'1 source, Func'2 predicate)\r\n
at ZBookings.BookingService.MoveBooking[TBookingType](Int32 bookingId, >IEnumerable`1 bookingSlots) in
C:\dev\ZBooking.Client\core\ZBookings.Services\BookingService.cs:line 79\r\n\r\nException rethrown at [0]: \r\n at ZBookings.BookingService.<>c_DisplayClass9`1.b_5(BookingSlot p) in
C:\dev\ZBookings\core\ZBookings.Services\BookingService.cs:line 79\r\nat System.Linq.Enumerable.All[TSource](IEnumerable'1 source, Func'2 predicate)\r\n
at ZBookings.BookingService.MoveBooking[TBookingType](Int32 bookingId, IEnumerable`1 bookingSlots) in
C:\dev\ZBookings\core\ZBookings.Services\BookingService.cs:line 79"
However, when this is displayed by the standard ASP.NET yellow screen it is:
[NullReferenceException: Object reference not set to an instance of an object.]
ZBooking.ApplicationServices.MethodMarshaller.Invoke(Delegate del, ZipIdentity zipIdentity, Object[] args) in C:\dev\ZBooking\core\ZBooking.ApplicationServices\MethodMarshaller.cs:147
ZBooking.ApplicationServices.MethodMarshaller.Invoke(Delegate del, ZipIdentity zipIdentity, Object[] args) in C:\dev\ZBooking\core\ZBooking.ApplicationServices\MethodMarshaller.cs:105
ZBooking.ApplicationServices.MethodMarshaller.Call(Func'3 del, T1 arg1, T2 arg2, ZipIdentity zipIdentity) in C:\dev\ZBooking\core\ZBooking.ApplicationServices\MethodMarshaller.cs:72
...etc.
Calling Server.GetLastError();
on Application_Error in Global.asax shows the correct stack trace. Where is the yellow screen stack trace coming from?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ASP.NET 的黄屏死机通过构造 < 来获取堆栈跟踪code>StackTrace 来自异常。它使用
StackTrace(Exception, Boolean)
< /a> 构造函数。然后,它通过遍历提供的 StackFrame 对象来转储堆栈通过StackTrace
对象。它不使用Exception.StackTrace
属性。ASP.NET's yellow screen of death gets the stack trace by constructing a
StackTrace
from the exception. It does this using theStackTrace(Exception, Boolean)
constructor. It then dumps the stack by walking the StackFrame objects supplied by theStackTrace
object. It does not use theException.StackTrace
property.