Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7059315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:13:03+00:00 2026-05-28T04:13:03+00:00

I have failed submission (can’t even get past upload verification) because my background agent

  • 0

I have failed submission (can’t even get past upload verification) because my background agent creates two instances, but I can’t figure out why.

Here is the method, in app.xaml.cs (I have also tried locating it in the MainPageVM.cs and MainPage.xaml.cs with the same results)

private void RegisterBackgroundTask()
{
    var taskName = "xxUpdater";
    var oldTask = ScheduledActionService.Find(taskName) as PeriodicTask;
    if (oldTask != null)
    {
        ScheduledActionService.Remove(taskName);
    }
    PeriodicTask task = new PeriodicTask(taskName);
    task.Description = Strings.xxBackgroundTaskDescription;
    oldTask = ScheduledActionService.Find(taskName) as PeriodicTask;
    if (oldTask == null)
    {
        ScheduledActionService.Add(task);                 
    }
    //ScheduledActionService.LaunchForTest(taskName, TimeSpan.FromSeconds(60));
}

Here is the call, in Application_Launching:

private void Application_Launching(object sender, LaunchingEventArgs e)
{
      { RegisterBackgroundTask(); }
}

The first time the app runs, I back out, look, and there is one task. Then I run again, stepping through, and the remove call turns off the task (instead of removing it). When it gets to the add call, not only does it turn the original task on, but it adds another. From that point on, when I back out and restart the app, the remove turns ONE instance off, and leaves the other, and the Add call turns it back on. Never is oldTask null except after rebuild or uninstall.

The if(oldTask ==old) wasn’t initially there, I added it hoping that it would prevent the creation of the second instance. Sometimes, when I uninstall, there is still a background task that is turned off, and I have to turn the phone off and back on to get it to go away.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:13:03+00:00Added an answer on May 28, 2026 at 4:13 am

    I have the same problem with the project I’m working on.
    For some reason I had the backgroundtask defined twice in my WMAppManifest.xml
    Check you WMAppManifest.xml and see if you also have it defined twice.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a nightly batch job that can tell if it has failed. I
The developer documentation has seemed to have failed me here. I can create a
I have two questions about Javascript: How can I prevent my fields from being
I've been trying to re-upload a previously uploaded app (it originally failed submission), but
My google skills have failed. My interest is how much user information I can
My google search skills have failed me, and I am not a database expert
I have this quite popular problem, but have failed to find a solution that
My attempts to install modperl under the default vanilla Leopard Apache 2 have failed
That's the question. Give only one reason you think why have OODB failed or
Error: End tag for 'optgroup' which is not finished. You have probably failed to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.