I was trying to create a simple UWP application to access my webcam following tutorial https://developer.microsoft.com/en-us/windows/iot/samples/webcamapp using code at https://github.com/ms-iot/samples/tree/develop/WebcamApp/CS on my Windows 10 laptop using VS 2017, 15.5.3. Both x64 and x86 builds give me the same access denied error i.e.
Exception thrown: 'System.UnauthorizedAccessException' in System.Private.CoreLib.ni.dll WinRT information: Access is denied.
on line 202 in MainPage.xaml.cs at
await mediaCapture.InitializeAsync();
Before throwing the exception, the app does ask for the user permission to let it use the camera but even clicking yes does not make a difference.
My drivers for the camera are 100% up to date, and other UWP apps can access camera fine as was the case here. I have looked into other questions that talk about file IO access problems with UWP apps, but was unable to use them as a clue to solve the access to webcam.
Any help will be greatly appreciated. Thank you.