测试应用程序在返回按钮上失败... Windows Phone 7 [英] Test App failing on Back Button... Windows Phone 7

查看:21
本文介绍了测试应用程序在返回按钮上失败... Windows Phone 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,这个问题源于这个问题:wp7:应用失败!想不通在哪里?

Ok this question stems from this question: wp7: App failing! Can not figure out where?

我认为它已更正,但它仍然失败.我删除了所有 app.xaml.cs 代码,但在单击搜索按钮并立即按下后退按钮时它仍然崩溃.

I thought it was corrected but it is still failing. I ripped out all of the app.xaml.cs code and it still crashing when the search button is clicked and the back button is immediately pressed.

所以...我决定看看我是否可以用一个新的测试应用来重现这个问题.基本上我已经使用默认的主视图模型创建了一个基本的枢轴应用程序.我的代码都不存在...

So... I decided to see if I could replicate the issue with a new test app. Basically I have create a basic pivot application with the default Main View Model. None of my code exists...

我按下搜索按钮,然后立即按下后退按钮,然后低头看……同样的事情发生了……它使应用程序崩溃,模拟器显示空白屏幕,调试器停止!

I press the search button and then immediately press the back button and low and behold... The SAME THING HAPPENS.... It crashes the application, the emulator shows a blank screen and the debugger stops!

所以...这让我相信我在模拟器中发现了一个错误(我觉得这很难相信)...或者,我的 Studio 环境可能已损坏(我希望它不是).

So... That leads me to believe that I've found a bug in the emulator (I find this very hard to believe)... OR, my Studio environment maybe is corrupted (I'm hoping it is not).

我不知道该去哪里.我不知道错误是什么,它阻止了我的应用在市场上被接受.

I'm not sure where to go on this one. I don't know what the error is, and it is preventing my apps from being accepted on the market place.

有人有什么想法吗?

我截取了我所看到的内容:

请注意,第 1 个 3 搜索/返回组合的作用是允许显示搜索屏幕中的框.但是,最后 2 个搜索/返回组合不起作用,因为您会看到不允许显示这些框...

Notice that the 1st 3 search/back combos work as the boxes in the search screen are allowed to display. However, the last 2 search/back combos don't work as you will see that the boxes aren't allowed to display...

http://www.youtube.com/watch?v=XVht3OtBGaI

我从 Microsoft 收到的错误报告:

Comments: The application reactivate after deactivation and terminates unexpectedly.
Steps to reproduce:
1) Launch the application.
2) Select a vehicle.
3) Press the device's "Start" button.
4) Select the device's "Back" button.
5) Observe the application terminates unexpectedly and does not reactive the application.
This error is reproducible 8 out of 10 times.

来自不同应用程序的另一个错误报告:

The other error report from a different application:

Comments: The application terminates rather than resuming when the user attempts to return from a Search.
Steps to reproduce:
1. Launch the application
2. Select the Add + button
3. Press the Search button
4. Press the Back button
5. Observe the application terminates after a few seconds.

我注意到:

当调试器中发生以下情况时:

When the following happens in the debugger:

The thread '<No Name>' (0xd1b0092) has exited with code 0 (0x0).
The thread '<No Name>' (0xd6900ba) has exited with code 0 (0x0).

该项目不会如所描述的那样失败(100% 的情况下).但是,如果我在此之前单击后退按钮,则应用程序会失败(100% 的时间).

That the project DOES NOT FAIL as described (100% of the time). However, if I click the back button before this, then the application fails (100% of the time).

更新 #1:App.xaml.cs

// Code to execute when the application is launching (eg, from Start)
// This code will not execute when the application is reactivated
private void Application_Launching(object sender, LaunchingEventArgs e)
{
}

// Code to execute when the application is activated (brought to foreground)
// This code will not execute when the application is first launched
private void Application_Activated(object sender, ActivatedEventArgs e)
{
    // Ensure that application state is restored appropriately
    if (!App.ViewModel.IsDataLoaded)
    {
        App.ViewModel.LoadData();
    }
}

// Code to execute when the application is deactivated (sent to background)
// This code will not execute when the application is closing
private void Application_Deactivated(object sender, DeactivatedEventArgs e)
{
}

// Code to execute when the application is closing (eg, user hit Back)
// This code will not execute when the application is deactivated
private void Application_Closing(object sender, ClosingEventArgs e)
{
    // Ensure that required application state is persisted here.
}

推荐答案

好的,在我的头撞在桌子上几个小时后,我发现某些机器上的模拟器出现了我所看到的相同问题.

OK, after hours of banging my head against my desk I have found that the emulator on some machines are having the same issue I am seeing.

所以...我做的第一件事是将我所有的函数包装在 Try/Catch 块中...即使是最小的函数和不会出错的函数.然后我加载了应用程序,看看我是否可以让它崩溃.当我觉得我在手机上对其进行了充分的测试时,我重新提交了该应用程序.在测试说明部分,我要求他们在设备而不是模拟器上进行测试.我从来没有听说过他们是否这样做了,但他们通过了我的应用,所以我猜他们做到了.

So... The 1st thing I did was to wrap all my functions in Try/Catch blocks... Even the smallest functions and the ones that can't error. Then I side loaded the application to see if I can get it to crash. When I felt I sufficiently tested it on my phone I re-submitted the app. In the testing notes section I asked for them to test it on a device rather than an emulator. I never heard if they did this or not, but they passed my app, so I'm guessing that they did.

感谢@Praetorian 和@Matt Lacey 和@willmel 以及其他为我解决这个问题的人.我很感激!

Thanks to @Praetorian and @Matt Lacey and @willmel and anyone else that took a look at this problem for me. I appreciate it!

这篇关于测试应用程序在返回按钮上失败... Windows Phone 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆