in Windows 8

UnauthorizedAccessException while accessing camera

Recently I got that kind of Exception, UnauthorizedAccessException it occurred when I wanted initialize my webcamera in Windows 8 application.

access_deny_microphone_w8

The weirdest thing is that if your application just takes a photo you have to include in requirements that it has to allow a microphone…yes to microphone. Because CaptureControl.Source is a type of MediaCapture, and this class provide a possibility of  taking a photos, recording video and sound, in my opinion this is very weird because if I am making a embedded system it force from me that I have to provide a hardware that has got microphone.

In my opinion there should be a separate classes that provides taking a photos, and recording a video/sound.

Solution to that exception: You have to check in capabilities that your application require a microphone.

microphone_capabilities_w8

 

P.S “Odmowa dostępu” – yep I have polish version of VS, but it means “Access deny”

 

  • Amadeus Wieczorek

    Thanks! That helped

    • http://pawel.sawicz.eu/ Pawel Sawicz

      sure np. 🙂

  • njsokalski

    Although it is not hard to do, it may be confusing (not to mention annoying) to the user to be asked for microphone permission in an app that does not use it. I’ll be using MediaCapture until I find it, but I think it should be easier to find.