locked
MediaCapture.InitializeAsync() gives an exception

    Question

  • So basically I tried to create an app that makes use of the webcam. Everything works fine till I leave the app then go back to it. When I do this, I get this exception 'HRESULT = 0xC00D36B2, Message: "The request is invalid in the current state" '.

    I've seen a lot of people ask this question but I haven't seen an answer posted. Did anyone get around to solving this issue?


    EA

    Friday, May 8, 2015 11:07 PM

All replies

  • Hi Gregory

    If you tested with the sample, will the same exception thrown? https://code.msdn.microsoft.com/windowsapps/Media-Capture-Sample-adf87622

    And may I know if you are working for Windows Phone or Windows Store App?

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, May 11, 2015 3:08 AM
    Moderator
  • Hi Gregory

    If you tested with the sample, will the same exception thrown? https://code.msdn.microsoft.com/windowsapps/Media-Capture-Sample-adf87622

    And may I know if you are working for Windows Phone or Windows Store App?

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thanks ffor your reply. Sadly I couldn't run the program in the link. I had a whole bunch of errors.

    It was a Windows Store app I was working on btw


    EA

    Monday, May 11, 2015 12:38 PM
  • Hi Gregory,

     I had a whole bunch of errors.

    -> May I know if they are the runtime error or the compile error, we cannot give suggestions without seeing anything of them.

    I just did some quick search, looks like the error more like the app is not in a correct state for instance if we navigate to another page but current MediaElement or MediaCapture does not stop yet.

    Perhaps share us a repro demo is helpful with analysis the app.

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, May 13, 2015 7:01 AM
    Moderator
  • Hi Gregory,

     I had a whole bunch of errors.

    -> May I know if they are the runtime error or the compile error, we cannot give suggestions without seeing anything of them.

    I just did some quick search, looks like the error more like the app is not in a correct state for instance if we navigate to another page but current MediaElement or MediaCapture does not stop yet.

    Perhaps share us a repro demo is helpful with analysis the app.

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    These are the errors I got running the sample

    Error 1 The name "LayoutAwarePage" does not exist in the namespace "using:SDKTemplate.Common". 

    Error 2 The name "LayoutAwarePage" does not exist in the namespace "using:SDKTemplate.Common".

    Error 3 Error : DEP0700 : Registration of the app failed. Windows cannot install package Microsoft.SDKSamples.MediaCapture.CS because the package requires architecture ARM, but this computer has architecture x64. (0x80073cf3)

    The code for the initial app I tried creating is the exact same code as the one Jerry Nixon had on this page http://blog.jerrynixon.com/2012/10/walkthrough-capturing-photos-in-your.html.

    Sorry I don't have access to my laptop at the moment so I cant just copy and paste what I did but it's exactly what is on this page


    EA





    • Edited by Gregory-el Wednesday, May 13, 2015 10:44 AM
    Wednesday, May 13, 2015 10:40 AM
  • Hi Gregory

    I have no problem of running the sample, could you validate again if you cannot access to the SDKTemplate.Common namespace from your code? And does the file exist in the solution? Basically Common folder was added to project automatically when you create the Basic Page from the template.

    For the second one, the message is really clear, you may need to change the architecture from ARM to x64.https://social.msdn.microsoft.com/forums/windowsapps/en-us/06cf116d-f49e-49b3-bfd2-fa6feb814b98/sample-error-architecture-arm-architecture-x64 seems to be the same problem.

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, May 18, 2015 4:25 AM
    Moderator