问题描述:

I have created a background agent project and added it as a project reference in my main phone application project. I was expecting it to automatically update WMAppManifest.xml with something like the below:

<Tasks>

<DefaultTask Name="_default"

NavigationPage="MainPage.xaml" />

<ExtendedTask Name="MyBackgroundTask">

<BackgroundServiceAgent Specifier="ScheduledTaskAgent"

Name="FooManMark"

Source="BackgroundAgent"

Type="BackgroundAgent.ScheduledAgent" />

</ExtendedTask>

</Tasks>

The periodic task still seems to run in the background (at least in a debug build), so I am wondering if the extended task element is still used in Windows Phone 8?

I am using Visual Studio 2012 Update 4

网友答案:

That's a difference in Windows Phone 8 that this reference is not added to WMAppManifest when you add the project reference, but when you actually build the project. If build the project and unzip the created XAP file and check the content of the WMAppManifest, the ExtendedTask is there.
I've described this in more details here.

相关阅读:
Top