Search Unity

webcam cabability access denied after upgrading unity and visual studio

Discussion in 'VR' started by neymar4138, Jul 30, 2018.

  1. neymar4138

    neymar4138

    Joined:
    Jun 3, 2018
    Posts:
    1
    Hello everyone,

    I have an project that will run as a UWP application on the Hololens and access the hololens camera.
    The project is build with .NET scripting backend, targeting SDK Version 16299. Webcam and Microphone cabality as well as allow unsafe code are all setted up (these options are required for camera access). Last week I built it and it was running without any error and working perfectly. Then because of another project I upgraded my Unity to 2018.2. and Visual Studio Community to the latest update and now everytime I try to build that application it gives me following error after it ask for permission to use camera (and after I choose yes):

    > Exception thrown:
    > 'System.UnauthorizedAccessException'
    > in System.Private.CoreLib.ni.dll WinRT
    > information: Access is denied.

    I downgraded my Unity back to 2018.1 and Visual Studio to older versions but the problem still remains.
    However if I go back to the folder of the solution that was build with the original version that i had before I upgraded and start the generated solution from back then, it also works fine!
    But if I try to build a new solution from that project folder Visual studio throws errors, that it cannot find source files and metafiles. (So these old solutions still work, but generating new solutions from that project dont work)

    I have tried many things like uninstalling and deleting everything and installing again or change configurations but the problem still remains. Now I am very desperate and hope for your help! Thank you very much in advance!

    Here are the steps to reproduce if someone wants to test:
    1.Download this git project https://github.com/qian256/HoloLensARToolKit
    2.Open one of the sample scenes in the HoloLensARSample folder.
    3. import the asset ARToolKitUWP.unitypackage from the folder
    4. build with .NET scripting backend and check "allow unsafe code"
    5. open generated Visual Studio Project and run the app on Hololens or emulator
    with Release, x86.
    6. run the app and it should ask for permission to use the cam, after you choose yes the errors appear

    excepected output: camera stream visible in the white box

    Best regards
     
    Last edited: Jul 30, 2018
  2. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    404
    Hello neymar4138,

    We can offer one idea for now, which is to recompile your project entirely. To do this:
    1. Close any open instance of Unity editor
    2. Find the project folder which contains your Unity project
    3. Delete all folders EXCEPT the Assets and ProjectSettings
    4. Open your Unity editor and select the project again (loading time will be long due to recompiling the project)
    If this doesn't work, we have a suspicion this is tied to an ongoing dialog we are currently having with Microsoft over a known issue. We are actually leaning toward the latter, and that it will be resolved once we come to a solution with Microsoft's engineers. Unfortunately that leaves us with no way to promise when exactly a fix for this will land. Our engineers who have also seen this report that relaunching the app, after answers "Yes" to give the app permission has worked for them. But your mileage may vary.

    Which Hololens OS version are you running? Is it the RS4 version by chance?
     
  3. Xyy_1209

    Xyy_1209

    Joined:
    Nov 12, 2017
    Posts:
    6
    Hello. I'm using RS4 Preview system on HoloLens. An unauthorizedException occuered on the sentence "Initializeasync(settings)". Is it the problem of PS4? How can I deal with the problem? Thanks for help!