Skip to content

[BUG] CameraView crashes on Windows if microphone permission is denied #3139

@AopBK

Description

@AopBK

Current Behavior

When using CameraView on Windows, the control requires both camera and microphone permissions during initialization.
If the user denies the microphone permission, CameraView initialization fails and the application crashes with:
System.UnauthorizedAccessException
This happens even when the application only needs to take photos and does not require audio input.

Expected Behavior

CameraView should still allow camera usage when microphone permission is denied.

The control should continue working for:

  • photo capture
  • video recording without audio

Microphone access should only be required when audio recording is needed.

Steps To Reproduce

The bug can be reproduced using the official sample app included in the repository:

  1. Clone the CommunityToolkit.MAUI repository
  2. Run the sample application CommunityToolkit.MAUI.Sample
  3. Navigate to: Views → CameraView
  4. When the system permission dialog appears for the microphone, select "Deny"
  5. The application crashes with: System.UnauthorizedAccessException

Link to public reproduction project repository

https://github.com/CommunityToolkit/Maui/tree/main/samples

Environment

- .NET MAUI CommunityToolkit:14.0.1
- OS: Windows
- .NET MAUI: 10.0.102

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions