开发者

ResolveHostNameAsync breaks tombstoning?

开发者 https://www.devze.com 2023-03-27 06:18 出处:网络
I noticed an issue where calling DeviceNetworkInformation.ResolveHostNameAsync prevents the app from resuming from a tombstoned state.If you force tombstoning u开发者_如何学Cpon deactivation when debu

I noticed an issue where calling DeviceNetworkInformation.ResolveHostNameAsync prevents the app from resuming from a tombstoned state. If you force tombstoning u开发者_如何学Cpon deactivation when debugging (via the project settings, debug tab), pressing the Windows button and then the Back button to return to the app causes the phone/emulator to display "Resuming..." and never actually return from the tombstoned state.

To test this, I created a new WP7.1 app and added a button with the following action:

private void Button_Click(object sender, RoutedEventArgs e)
{
    DeviceNetworkInformation.ResolveHostNameAsync(new DnsEndPoint("google.com", 0), HostNameResolutionCallback, null);
}

For testing, my callback method doesn't actually do anything:

private static void HostNameResolutionCallback(NameResolutionResult result)
{
}

If you tap the button, exit, and then return to the app, it will display "Resuming..." until you press the Windows button again.

I am using the WP7.1 Beta 2 Refresh SDK.

Any ideas?


I suspect that you're starting the app with the debugger attached.
When you force tombstoning the process is being ended and so when you resume the emulator is waiting for you to restart the debugger so you can continue debugging the app.

This behaviour is by design. It is to allow you to continue debugging after tombstoning.

If you force tombstoning while debugging and the app appears to be stuck in the resuming state just hit F5 (Debug > Start Debugging) in Visual Studio to resume the app and the debug session.

0

精彩评论

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