Take the 2-minute tour ×

In my Package.appxmanifest file, I added a declaration for Background Tasks," because I will eventually need one - it hasn't been written yet. I selected "System event" as the Supported task type, but nothing in the App settings (Executable, Entry point, Start page) yet.

When I try to run the app after adding that declaration, I get: "App manifest is missing required element '/Package/Applications/Application/Extensions/Extension/BackgroundTasks/Task'"

So is there some value I can enter into one of the "App settings" edit boxes, or do I have to first create the Background Task before I declare that I'm going to use one, or...???


According to http://www.silverlightshow.net/items/Windows-8-metro-make-your-app-alive-with-background-tasks.aspx, the ControlChannel option can be used for sockets:

"ControlChannel: these tasks, only available in XAML/C# applications, can be notified when a network resource receive some data. These are related mostly with StreamSockets. Also this task requires the lock screen constraint."

The article also mentions: "...you can be notified about a number of system events. These event are triggered when something happen, like an incoming SMS, ..." but if I understand correctly, only Mobile Service Providers can implement the SMSReceived event.

But one of the things I'm still not clear on is: Can I create a class within my project that will be the background task, or do I need to add a project to my solution that will be/include the Background task? If the latter, should this project be a "Class Library (Windows Store Apps)" or "Windows Runtime Component" project type?

share|improve this question

3 Answers 3

You can define background task before actually implementing it, just:

  • in the manifest add capability Background Tasks, check Timer and in the Entry point line add the full name of the class containing the Background Task code. In my case I got there:


  • select type of Lock screen notifications and select Badge logo. Note Badge logo must be 24x24 and use only white color or (semi)transparent background

Update, the background task must be defined in another project and must be of type "Windows Runtime Component". Beware, projects of this type have several limitations and basically you won't be able to reference in it any other non-Windows Runtime Component libraries.

share|improve this answer
I hope there's another option besides Timer, because this task needs to always be running, listening for incoming messages (using sockets). –  B. Clay Shannon Nov 2 '12 at 15:01
There is no way, how to create Windows Store (Metro) app, that is "always running in background". You can either use Push Notifications, or background task running each 15 minutes to check for something, but not "always in background". –  Martin Suchan Nov 2 '12 at 16:19
Then how could a socket app be created? You never know when a message is going to come in via a socket. I think you're probably wrong, and I certainly hope you are. –  B. Clay Shannon Nov 2 '12 at 18:00
From code.msdn.microsoft.com/windowsapps/…: A background task can run even when the app that registered the background task is suspended. ... •Creating a background task that is triggered by a system event. So the background task, in order to be ever-ready to respond to an event, must be like a big cat hiding in the brush, normally stock still but always ready to pounce. –  B. Clay Shannon Nov 2 '12 at 18:19
Also, here: msdn.microsoft.com/en-us/library/windows/apps/xaml/… it says, "This topic shows how to maintain network connections when a Windows Store app is in the background." –  B. Clay Shannon Nov 3 '12 at 1:28

You must create at least the entry point to be able to list it in the app manifest.

share|improve this answer
What are the requirements for this entry point? Does it need to have a particular signature? –  B. Clay Shannon Oct 31 '12 at 23:45
Yes -- look at this link for more info on how to construct them: msdn.microsoft.com/en-us/library/windows/apps/… –  gdc Nov 2 '12 at 1:51
Thanks, but that link provides only very minimal info and scant detail. –  B. Clay Shannon Nov 2 '12 at 16:17

You can define background task in app manifest file. There is no such requirements on where the background task is defined, you can put you first page address. See image below. You need to define Task Type. In my case I defined Timer. Also the Entry point which in my case I defined ItemsPage.cs, (I don't have Background Task in ItemsPage.cs). enter image description here

After that you need to have Badge logo and Lock Screen Notifications in Application UI tab. enter image description here

share|improve this answer
I'm guessing for my situation I probably need "System event" (assuming there is a system event for an incoming socket message). It seems that Entry point = <name of unit> seems too vague, though -isn't it necessary to declare the exact name of the .dll that will run? And then - what "shape" should that take? –  B. Clay Shannon Nov 2 '12 at 15:07
Yeah it needs to be NameOfTheDll.NameOfTheUnit, it'll be the same thing. Checkout following example. Background Task Sample –  Mayank Nov 2 '12 at 16:58

Your Answer


