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 9130913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:03:07+00:00 2026-06-17T08:03:07+00:00

I am writing a Metro App that will only run on PCs (so there

  • 0

I am writing a Metro App that will only run on PCs (so there is no, or at least less, worry about the battery life). I need it to register and run a background task when the user clicks a button. It registers fine, but I have found no way to make it run sooner than at a 15 minute delay, which is useless for this app. Any ideas how I can get it to run immediately?

Also I have found a similar question here that says its not possible, but someone must have figured out a way.

Edit:

My reasoning for requiring this task is such:

My app will be reading and writing files as they appear over an extended period of time, anywhere from a few minutes to several hours. During the majority this time, it is unlikely that the app will be presented in the foreground. Because I need the code to be able to continue executing, it seemed the best way was to create a background task, but I can find no way to manually initiate this task outside of Visual Studio, though in Visual Studio it works perfectly. If there is a more appropriate way to handle this execution, I am willing to use it.

  • 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-06-17T08:03:08+00:00Added an answer on June 17, 2026 at 8:03 am

    EDIT

    Revision due to the extra information from OP.

    The only way I can think you could do this via a metro app is to ask your user to “snap” your app against the desktop – on your snapped app they can hit start/stop and carry only using the desktop at the same time with both apps running in the foreground.


    I think my other answer is not complete so I will try to offer a better answer.

    To clarify: you state that your whole reason for using a background task is so your app will continue running some code even if your app is suspended.

    Background Tasks:

    You cannot trigger a WinRT background task to run immediately.

    Bear in mind that a background task by default has 1 second of CPU every 2 hours and there’s no way of specifying when it will activate – you can only use opportunistic triggering – no good to you in this case.

    Further, even if your app is made a lock-screen application, you cannot specify the immediate processing of a background task unless you are using push notifications, which aren’t appropriate for what you are trying to do. For a lock-screen app you’d generally get 2 seconds of CPU every 15 minutes.

    OnSuspending:

    However, if your app is being suspended you still have a few seconds (5, according to this: http://www.redlist.ch/post/Time-limit-on-suspending-a-WinRT-app.aspx) of time to tidy up before your app is suspended by the OS. This suspension-grace-time is longer than the time you would have in the background task anyway!

    Therefore, I would suggest not using background tasks and instead to initiate a background thread (as per my other answer) to do your button-press action (using local state to record its progress). Now, if you also hook into the App onsuspending event, you can use this to see if something hasn’t been completed from a button-press action and complete it.

    Hope it makes sense. Good luck!

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

Sidebar

Related Questions

I am writing a metro app. This works: HttpClient client = new HttpClient(); var
I'm writing a Windows 8 Metro app (client-server) and would like to allow my
In my C#/XAML metro app, there's a button which kicks off a long-running process.
I am writing a Metro App. I am trying to read a file and
I am writing a metro app where it makes sense for focus to jump
Writing an iPhone app, and I'm getting my data from a REST API that
Writing a routine WinForms app that references a few custom libraries written by myself.
Writing an application in Cocoa that will take input from the user, format it
I'm writing a Windows 8 Metro app in C#/XAML. One of the core functions
I'm writing a Metro app in Windows 8 Consumer Preview. However, I'm unable 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.