Windows Mobile 10 Background Task DNS Fails

早过忘川 提交于 2019-12-11 05:59:52

问题


I am running into a problem with my background task on Windows Mobile 10 (build 10.0.14393.82). In my background task, HTTP client is sometimes throwing an Exception with the error (note it seems to happen when the phone is locked):

The server name or address could not be resolved

The phone shouldn't have an issue resolving the address, since it resolves it fine when running in the foreground.

Has anyone else seen this issue, or have any ideas?


回答1:


check the IsNetworkRequested property when registering your background task: https://docs.microsoft.com/en-us/uwp/api/Windows.ApplicationModel.Background.BackgroundTaskBuilder#properties_




回答2:


Do you check (or does your background task scheduler check) if there is an active Internet connection before you make your DNS probe request? It looks like the device is turning wireless off during sleep mode.



来源:https://stackoverflow.com/questions/39300532/windows-mobile-10-background-task-dns-fails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!