Answered by:
Error in Review Submission (ScheduledTaskAgent)

Question
-
Hi,
I am developing Windows Phone 8 application (C#, XAML). It is an application with a ScheduledTaskAgent.
When uploading the XAP file to the store I am getting this error:
2012: Agent myAppScheduledTaskAgent doesn’t have a valid entry assembly.
the WMAppManifest.xml is the following:
<?xml version="1.0" encoding="utf-8"?> <Deployment xmlns="http://schemas.microsoft.com/windowsphone/2012/deployment" AppPlatformVersion="8.0"> <DefaultLanguage xmlns="" code="en-US" /> <App xmlns="" ProductID="{131a9dc4-85a8-4b60-9647-962772634493}" Title="myApp" RuntimeType="Silverlight" Version="1.3.0.0" Genre="apps.normal" Author="Eitan Barazani" Description="The myApp application will track you App.
" Publisher="YASIG Engineering" PublisherID="{4904fd05-1902-4f0b-ae9f-f66ad77f49bf}"> <IconPath IsRelative="true" IsResource="false">Assets\ApplicationIcon.png</IconPath> <Capabilities> <Capability Name="ID_CAP_NETWORKING" /> <Capability Name="ID_CAP_WEBBROWSERCOMPONENT" /> </Capabilities> <Tasks> <DefaultTask Name="_default" NavigationPage="Views/ReadDataPage.xaml" /> <ExtendedTask Name="BackgroundTask"> <BackgroundServiceAgent Specifier="ScheduledTaskAgent" Name="myAppScheduledTaskAgent" Source="myAppScheduledTaskAgent" Type="myAppScheduledTaskAgent.ScheduledAgent" /> </ExtendedTask> </Tasks> <Tokens> <PrimaryToken TokenID="myAppToken" TaskName="_default"> <TemplateFlip> <SmallImageURI IsRelative="true" IsResource="false">Assets\Tiles\FlipCycleTileSmall.png</SmallImageURI> <Count>0</Count> <BackgroundImageURI IsRelative="true" IsResource="false">Assets\Tiles\FlipCycleTileMedium.png</BackgroundImageURI> <Title>myApp</Title> <BackContent> </BackContent> <BackBackgroundImageURI IsRelative="true" IsResource="false"> </BackBackgroundImageURI> <BackTitle>myApp</BackTitle> <LargeBackgroundImageURI IsRelative="true" IsResource="false">Assets\Tiles\FlipCycleTileLarge.png</LargeBackgroundImageURI> <LargeBackContent /> <LargeBackBackgroundImageURI IsRelative="true" IsResource="false"> </LargeBackBackgroundImageURI> <DeviceLockImageURI IsRelative="true" IsResource="false"> </DeviceLockImageURI> <HasLarge>True</HasLarge> </TemplateFlip> </PrimaryToken> </Tokens> <ScreenResolutions> <ScreenResolution Name="ID_RESOLUTION_WVGA" /> <ScreenResolution Name="ID_RESOLUTION_WXGA" /> <ScreenResolution Name="ID_RESOLUTION_HD720P" /> </ScreenResolutions> </App> </Deployment>
My ScheduledAgent.cs file is the following:
namespace myAppScheduledTaskAgent { public class ScheduledAgent : ScheduledTaskAgent { /// <remarks> /// ScheduledAgent constructor, initializes the UnhandledException handler /// </remarks> static ScheduledAgent() { // Subscribe to the managed exception handler Deployment.Current.Dispatcher.BeginInvoke( delegate { Application.Current.UnhandledException += UnhandledException; } ); } /// Code to execute on Unhandled Exceptions private static void UnhandledException( object sender, ApplicationUnhandledExceptionEventArgs e ) { if ( Debugger.IsAttached ) { // An unhandled exception has occurred; break into the debugger Debugger.Break(); } } /// <summary> /// Agent that runs a scheduled task /// </summary> /// <param name="task"> /// The invoked task /// </param> /// <remarks> /// This method is called when a periodic or resource intensive task is invoked /// </remarks> protected override async void OnInvoke( ScheduledTask task ) { tileCount = 2;
UpdateMainFlipTile( tileCount ); #if DEBUG_AGENT // If debugging is enabled, launch the agent again in one minute. ScheduledActionService.LaunchForTest( task.Name, TimeSpan.FromSeconds( 60 ) ); #endif // Call NotifyComplete to let the system know the agent is done working. NotifyComplete(); } .
.
.}
When uploading the XAP I am getting the above error.
When loading the application to the debugger and on my Device the application works fine.
I tried to remove the ExtendedTask definition from the manifest:<ExtendedTask Name="BackgroundTask"> <BackgroundServiceAgent Specifier="ScheduledTaskAgent" Name="myAppScheduledTaskAgent" Source="myAppScheduledTaskAgent" Type="myAppScheduledTaskAgent.ScheduledAgent" /> </ExtendedTask>
The uploading the XAP file completes without an error, but there the scheduled task agent doesn't work either. :(
Any idea what am I doing wrong here?
Thanks,
EitanB- Edited by EitanBarazani Tuesday, August 20, 2013 7:39 AM
Tuesday, August 20, 2013 5:58 AM
Answers
-
Hi Eitan,
It is difficult to tell without the full project. Did you follow these steps?
http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202941(v=vs.105).aspx
Jeff Sanders (MSFT)
@jsandersrocks - Windows Store Developer Solutions @WSDevSol
Getting Started With Windows Azure Mobile Services development? Click here
Getting Started With Windows Phone or Store app development? Click here
My Team Blog: Windows Store & Phone Developer Solutions
My Blog: Http Client Protocol Issues (and other fun stuff I support)- Marked as answer by EitanBarazani Tuesday, August 20, 2013 4:06 PM
Tuesday, August 20, 2013 12:36 PM
All replies
-
Hi Eitan,
It is difficult to tell without the full project. Did you follow these steps?
http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202941(v=vs.105).aspx
Jeff Sanders (MSFT)
@jsandersrocks - Windows Store Developer Solutions @WSDevSol
Getting Started With Windows Azure Mobile Services development? Click here
Getting Started With Windows Phone or Store app development? Click here
My Team Blog: Windows Store & Phone Developer Solutions
My Blog: Http Client Protocol Issues (and other fun stuff I support)- Marked as answer by EitanBarazani Tuesday, August 20, 2013 4:06 PM
Tuesday, August 20, 2013 12:36 PM -
Thx!
EitanBTuesday, August 20, 2013 4:06 PM -
I had same problem, just build solution, by selecting release mode in dropdown. and take xap from release folder. error will be resolved while uploading in store.
Regards,
Punit Belani
- Proposed as answer by Punit Belani Wednesday, March 12, 2014 6:50 PM
Wednesday, March 12, 2014 6:50 PM -
Hi Jeff,
I was facing the exact same issue. I tried all combinations of building and deploying the app but it didn't help. Plus, while I was developing the app I followed the mentioned guidelines and just rechecked everything to be in place. Any idea where i could be going wrong?
Thanks!
Shivang Kumar
Sunday, July 26, 2015 3:21 PM -
No I have no idea, sorry!
I would suggest you try a simplest repro of the issue by creating a new project following the example above. If the problem does not repro then you can use WinDiff to see what is different in the files (including project files). If that does not help you will need to submit a support incident.
Jeff Sanders (MSFT)
@jsandersrocks - Windows Store Developer Solutions @WSDevSol
Getting Started With Windows Azure Mobile Services development? Click here
Getting Started With Windows Phone or Store app development? Click here
My Team Blog: Windows Store & Phone Developer Solutions
My Blog: Http Client Protocol Issues (and other fun stuff I support)Monday, August 3, 2015 1:58 PM