locked
Problem With Background Task - App is not registered for the Windows.BackgroundTasks contract or is not installed

    Question

  • Hi guys,

    I am having issue with implementing Background Task. I am using a timer trigger and first realized that the app will crash whenever a background task is schedule to run. Upon further digging, event viewer shows the message "App is not registered for the Windows.BackgroundTasks contract or is not installed".

    As far as I know, this would happen if I didn't declare the background task in manifest - which I did. I've tried getting help from the chat system on this website and was assisted with a helpful MS rep, Matt, but he too couldn't find out what was wrong.

    He suggested I post for help here while he investigates further. Anyone have any ideas? Anything I couldv'e missed?

    Thanks in advanced.

    Wednesday, March 11, 2015 8:19 AM

Answers

  • The problem is that the background task needs to be a WinRT Component in it's own library. After I created the task as a WinRT Component, it worked as expected.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, March 11, 2015 5:04 PM
    Moderator

All replies

  • Hi Ruqqq - I am still looking into this.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, March 11, 2015 12:21 PM
    Moderator
  • The problem is that the background task needs to be a WinRT Component in it's own library. After I created the task as a WinRT Component, it worked as expected.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, March 11, 2015 5:04 PM
    Moderator
  • Hi Matt,

    Thank you for the help! Indeed that was the fix.

    Thursday, March 12, 2015 3:37 AM