Agent myAppScheduledTaskAgent doesnĄ¯t have a valid entry assembly

Agent myAppScheduledTaskAgent doesnĄ¯t have a valid entry assembly

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.&#xA;" 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?
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

  • Back aarticle:
  • Next aarticle: No
  • Copyright © 2007-2012 www.chuibin.com Chuibin Copyright