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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:31:21+00:00 2026-06-02T23:31:21+00:00

I created a scheduler for my web app, which is setup to be fired

  • 0

I created a scheduler for my web app, which is setup to be fired every 3 seconds. I want to use Console.Write(“bob”) to see if the scheduler is working properly, but nothing happened, only the web page is created after I click the ‘debug’ button. Am I testing the wrong way or the scheduler is indeed not working?

Here’s the code I wrote:

namespace Scheduler
{
    public partial class CheckExpireService : ServiceBase
    {
        private CheckExpireJob job;
        private Timer stateTimer;
        private TimerCallback timerDelegate;


        public CheckExpireService()
        {
            InitializeComponent();
        }

        protected override void OnStart(string[] args)
        {
            job = new CheckExpireJob();
            timerDelegate = new TimerCallback(job.CheckExpireApplicants);
            stateTimer = new Timer(timerDelegate, null, 1000, 3000);
        }

        protected override void OnStop()
        {
            stateTimer.Dispose();
        }
    }
}


namespace Scheduler
{
    class CheckExpireJob: ServiceBase
    {
        public void CheckExpireApplicants(object stateObject) {
        Console.Write("bob");
        }
    }
}

Thanks in advance!!

  • 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-02T23:31:24+00:00Added an answer on June 2, 2026 at 11:31 pm

    (I was going to leave a comment, but edit and answer are the only things I seem to have available.)

    First, I don’t think you can run a Windows Service in Debug mode…it has to be compiled and installed as a service and started and stopped with the services manager in Windows. If you have this code somewhere in a web application, it will not work. It needs to be a seperate project.

    Second, you can’t construct and call a service like this. If you want a service that does something on a timed interval, you need to have the timer and all of its workings within the service.

    You can’t schedule a web app…it runs when someone visits the page. What is it that you REALLY need to schedule? Regular updates of the data that the web app will pull from?

    Need to know more about what you are trying to accomplish to be any help.

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

Sidebar

Related Questions

I created a console app that I want to use in a scheduled package
I have created a web-service app and i want to populate my view controllers
I'm trying to integrate quartz scheduler into a struts2 web app. Just wondering where
I want to create an blackberry application that acts as a scheduler, which scheduled
not so long ago I´ve created a small iphone app for my Daily use.
I want to create a web app on GAE in Go and I need
I have a TimerService created with @Schedule annotation, but I want to be able
I created a new ASP.net MVC Web Application project. Inside my application, I created
I created a task in Windows 7 task scheduler. How do I run it
I'm creating an app that needs to be accessed by both a web front

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.