开发者

Why is Exception StackTrace null in MonoTouch 4 running on device?

开发者 https://www.devze.com 2023-03-01 06:16 出处:网络
I\'ve just updated to MT 4.0.1 from 3.2.6. Now it seems that exception reports no longer contain stack traces when running on the device.

I've just updated to MT 4.0.1 from 3.2.6. Now it seems that exception reports no longer contain stack traces when running on the device.

I have an exception handler attached to AppDomain.CurrentDomain.UnhandledException that I use to save 开发者_JS百科an exception report to a file. On the simulator in both Debug & Release modes, UnhandledExceptionEventArgs.ExceptionObject.StackTrace is set. On the device in both Debug & Release modes that property is null.

I have tried checking "Emit debugging information" in the "Compiler" section of the project options. I have tried adding "--nosymbolstrip" to the MT build args. I have tried LLVM both enabled and disabled.

Any ideas? We will not be able to update in the App Store until we're confident that any exception reports we receive contain the necessary diagnostic info.


What information does ExceptionObject.ToString() provide? It should include the error message and stack trace. I know this has been working for me, b/c I recently used it to submit a bug to Novell.

Also, you might want to wrap a try-catch around your app startup in static void Main(), as AppDomain.UnhandledException is meant to be used for off-thread exceptions.


This would seem to be fixed in MonoTouch 4.0.4.1, though I didn't see that mentioned in the update description. Perhaps someone from Xamarin can confirm it was fixed on purpose.

For the record, it was stack traces in general that were broken on device, not just those associated with an exception. Formerly if you did new StackTrace() then its frames would be incomplete.

0

精彩评论

暂无评论...
验证码 换一张
取 消