-
Notifications
You must be signed in to change notification settings - Fork 473
Description
Is there an existing issue for this?
- I have searched the existing issues
Did you read the "Reporting a bug" section on Contributing file?
- I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug
Current Behavior
Taking a photo on a Surface Go 2 or 3 cause the app to crash immediately with the following Exception. It's worse on a Surface Go 2 then on a 3.
Exception:
System.Runtime.InteropServices.COMException: This object needs to be initialized before the requested operation can be carried out.
This object needs to be initialized before the requested operation can be carried out.
Stacktrace:
IReadOnlyDictionary<string, MediaFrameSource> MediaCapture.get_FrameSources()
//src/CommunityToolkit.Maui.Camera/CameraManager.windows.cs in async void d__22.MoveNext() at line 152:3
//src/CommunityToolkit.Maui.Camera/CameraManager.windows.cs in async void d__23.MoveNext() at line 132:3
/_/src/CommunityToolkit.Maui.Camera/Handlers/CameraViewHandler.shared.cs in async void CameraViewHandler.ConnectHandler(FrameworkElement platformView) at line 87:3
Called from: Task.cs in void Task.ThrowAsync(Exception exception, SynchronizationContext targetContext)+(object state) => { }
Expected Behavior
The app should not crash.
May be related: #2559 - although the current exception is different.
Steps To Reproduce
The key to replicating is taking a photo on a Surface Go 2 and 3. The existing Toolkit code sample can be use to replicate.
Link to public reproduction project repository
Environment
- .NET MAUI CommunityToolkit:CommunityToolkit.Maui.Camera 5.0
- OS: Windows 11
- .NET MAUI: 10Anything else?
No response