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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:27:12+00:00 2026-06-13T02:27:12+00:00

When I am debugging on my machine httpModule fires normally now after publishing it

  • 0

When I am debugging on my machine httpModule fires normally now after publishing it to IIS it does not run, what am I doing wrong? Am I missing something?

here is what it looks like in web.config

<httpModules>
     <add type="MyApp.Web.Mvc.Modules.Scheduler" name="Scheduler" />
</httpModules>

then the Scheduler looks like this

public class Scheduler : IHttpModule
{   
private static readonly object Job;
private static Timer timer;

static Scheduler()
{
    Job = new object();
}

void IHttpModule.Init(HttpApplication application)
{
    try
    {

        if (timer == null)
        {
            var timerCallback = new TimerCallback(ProcessJobs);
            const int startTime = 10 * 1000;
            const int timerInterval = 60 * 1000; // 1 minute
            timer = new Timer(timerCallback, null, startTime, timerInterval);
        }
    }
    catch (Exception ex)
    {
        //exception code here
    } 
}

public void Dispose()
{
}

protected void ProcessJobs(object state)
{
    try
    {
        // This protects everything inside from other threads that might be invoking this
        // which is good for long running processes on the background
        lock (Job)
        {
            //My Stuff
        }
    }
    catch (Exception ex)
    {
        //exception code here
    }
}
}
  • 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-13T02:27:13+00:00Added an answer on June 13, 2026 at 2:27 am

    If you are hosting on IIS 7.0+ integrated pipeline mode make sure that you have declared your module inside the <system.webServer><modules>...<modules></> section:

    <system.webServer>
        ....
        <modules>
            <add name="Scheduler" type="MyApp.Web.Mvc.Modules.Scheduler" />
        </modules>
    </system.webServer>
    

    And by the way make sure you have read The Dangers of Implementing Recurring Background Tasks in ASP.NET article by Phil Haack before putting this code in production.

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

Sidebar

Related Questions

While debugging and keep pressing F5, if the source code does not exist, eclipse
On one dev machine, the standard method for enabling SharePoint debugging is not working.
Visual studio 2010 was debugging fine on Win 7 , 64-bit machine. after installing
Context: I am currently debugging an issue where the binaries generated in one machine
I've set up debugging in Visual Studio 2008 to IIS instead of the built
When I am debugging on my Windows 7 IIS7 machine, I get this error
I've been experiencing nasty lockups while debugging under VS2008, SP1 on my machine. I
Using VS2008 on my local dev machine, when I run my asp.net Web Application
weird issue with visual studio 2010, right now i'm debugging a web application (which
Started up remote debugging a C++ project today on a Win 7 machine running

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.