locked
Unable to register background agent RRS feed

  • Question

  • This is a repeat of a question that I asked in the preview forum. It turns out that this is not resolved in 8.1 RTM and I'm not sure how to fix it. The exact same code worked perfectly fine in 8.0...

    I am unable to register the background agent for my application.  It is giving me an exception:

    System.Exception: Element not found. (Exception from HRESULT: 0x80070490)
       at Windows.ApplicationModel.Background.BackgroundExecutionManager.RequestAccessAsync()

    I get the same problem whether I have any breakpoints set at all (some blogs have suggested that having a breakpoints set causes the problem).

    How can I fix this so I can test my background agent?

    Stefan

    Saturday, October 19, 2013 6:21 PM

All replies

  • this also happend in windows 8 when you asked for the request access if you already did before. try this code:

    if (BackgroundAccessStatus.Unspecified == BackgroundExecutionManager.GetAccessStatus())
                {
    
                    var result = await BackgroundExecutionManager.RequestAccessAsync();
    }


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Saturday, October 19, 2013 7:24 PM
  • Thanks for the suggestion. The user has never been given the opportunity to specify access in this case, and the value is currently Unspecified.
    Saturday, October 19, 2013 7:34 PM
  • is there a project that you can share that elt us test? the code here above i am using

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Saturday, October 19, 2013 10:28 PM
  • No, only in my app at the moment.
    Sunday, October 20, 2013 3:01 AM