TargetInvocationExceptions
アプリケーション内に、内部例外を回避して取得するリモーティング タイプを設定しています。クラスで内部PrepForRemoting
メソッドを呼び出してException
、呼び出されたメソッドからのスタック トレースを保持します。
これにより、スタック トレース プロパティが正しく構築されているように見えます。
"\r\nサーバー スタック トレース: \r\n
C:\dev\ZBookings\core\ZZBookings.Services\BookingService.cs:line 79の ZBooking.Environment.Services.BookingService.<>c_ DisplayClass9`1.b _5(BookingSlot p) で\r\n
System.Linq.Enumerable.All[TSource](IEnumerable'1 ソース、Func'2 述語) で\r\n
C:\dev\ZBooking.Client\core\ZBookings.Services\BookingService.cs の ZBookings.BookingService.MoveBooking[TBookingType](Int32 bookingId, >IEnumerable`1 bookingSlots):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:line 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:line 79"
ただし、これを標準の ASP.NET イエロー スクリーンで表示すると、次のようになります。
[NullReferenceException: オブジェクト参照がオブジェクトのインスタンスに設定されていません。] C:\dev\ZBooking\core\ZBooking.ApplicationServices\MethodMarshaller の ZBooking.ApplicationServices.MethodMarshaller.Invoke(Delegate del, ZipIdentity zipIdentity, Object[] args)。 C:\dev\ZBooking\core\ZBooking.ApplicationServices\MethodMarshaller.cs:105 ZBooking.ApplicationServices.MethodMarshaller.Call(Func 内の cs:147 ZBooking.ApplicationServices.MethodMarshaller.Invoke(Delegate del, ZipIdentity zipIdentity, Object[] args) '3 del、T1 arg1、T2 arg2、ZipIdentity zipIdentity) in C:\dev\ZBooking\core\ZBooking.ApplicationServices\MethodMarshaller.cs:72
...など。
Global.asax で Application_Error を呼び出すServer.GetLastError();
と、正しいスタック トレースが表示されます。イエロー スクリーンのスタック トレースはどこから来ていますか?