我刚刚在商店中启动了一个应用程序,通过检查我的错误报告,我意识到我从 MSDN 获取的一个通用代码片段在 Lumia 520 设备上崩溃了。我可以阻止 52x 所有者下载此应用程序吗?
[编辑]
这是代码:
// Use the back sensor as the default sensor
CameraSensorLocation defaultSensor = CameraSensorLocation.Back;
// If the user already configured the front sensor, use it (true=front, false=back)
if ((bool)appSettings["sensor"]) { defaultSensor = CameraSensorLocation.Front; frontMode.Visibility = System.Windows.Visibility.Visible; }
// Let's check which sensors exist
var availableLocations = PhotoCaptureDevice.AvailableSensorLocations;
// There comes the bug
var captureRes = PhotoCaptureDevice.GetAvailableCaptureResolutions(defaultSensor);
这是异常(不包含内部异常):
异常消息:
The request is not supported. (Exception from HRESULT: 0x80070032)
堆栈跟踪:
at Windows.Phone.Media.Capture.PhotoCaptureDevice.GetAvailableCaptureResolutions (CameraSensorLocation sensor)
at Vixl.Pages.ShootPage.<openCamera>d__c.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__0(Object state)
GetAvailableCaptureResolutions
作为异步方法,相关部分只是堆栈顶部的第一级异常消息。传感器是后传感器,而不是前传感器。我将调查这个特定的错误。