什么会导致 WP7 应用程序毫无例外地崩溃
我有一个应用程序在设备模拟器上运行正常,但在真实设备上它会在一段时间后崩溃。它可能会在几分钟后发生,也可能在 1-2 小时后发生。 无论是单独使用设备还是连接到 Visual Studio,都会出现此问题。
重点是没有抛出异常,VS 只是报告连接丢失。 我确实检查过我是否使用了太多内存,但事实并非如此(http://stackoverflow.com/questions/4239193/whats-causing-my-wp7-app-to-crash)。
什么会导致应用程序崩溃而不引发异常?
I have an app that works ok on the device emulator but on the real device it crashes after some time. It can happen after some minutes as well after 1-2 hours.
The problem happens both with the device alone or attached to visual studio.
The point is that no exception is being thrown, VS just reports the connection was lost.
I did check if i'm using too much memory but that's not the case (http://stackoverflow.com/questions/4239193/whats-causing-my-wp7-app-to-crash).
What can cause apps to crash without throwing exceptions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
它可能会在Stackoverflow。
调试时,您可以通过向
Application.UnhandledException
添加事件处理程序并在Debug.WriteLine
方法中写入异常详细信息来检测此类异常。结果在 Visual Studio 输出/调试窗口中可见。It can crash without a visible exception on a Stackoverflow.
While debugging, you can detect such an exception by adding an event handler to
Application.UnhandledException
and writing the exception details in theDebug.WriteLine
method. The result is visible in the Visual Studio Output / Debug window.如果发生在非 UI 线程上,您可能会遇到无法捕获的崩溃。检查您的异步调用。
此外,响应应用程序栏按钮项或菜单项上的操作而执行的代码中的任何错误都可能导致此行为。
You could get a crash that isn't caught if it happens on a non-UI thread. Check your async calls.
Also, any error in code that is executed in response to an action on an application bar button item or menu item could have cause this behaviour.
物理设备可能与仿真配置不完全匹配。您可能正在将错误发送到设备上不存在的输出流,或者将其发送到模拟器本地和设备远程的内容。
此外,你可能只是满足了不同的条件,才能干净地退出。
与许多设备上的所有后台应用程序相比,模拟器可能运行得干净。
日志记录和调试是您的朋友。
你的问题很有趣,但缺乏细节。
It could be that the phsycal device does not exactly match the emulation configuration. You may be sending an error to a output stream that does not exist on the device, or sending it to something that is local for the emulator and remote for the device.
Also, you may just be satisfying different conditions that bring you to a clean exit.
The emulator is probably running clean compared to all the background applications on many devices.
Logging and debuging are your friends.
Your question is interesting but lacks detail.
我遇到过一些无效的 xaml 导致应用程序崩溃的实例。
您可以更改 Visual Studio 中的异常设置,以中断所有异常以跟踪正在发生的情况。
I have had a few instances of invalid xaml crashing the app.
You can change the settings in visual studio for exceptions to break on all exceptions to track down what is happening.