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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:35:53+00:00 2026-05-23T19:35:53+00:00

We have built a window service that listens to folders with FileSystemWatcher , when

  • 0

We have built a window service that listens to folders with FileSystemWatcher, when created we process the file and so on. But after couple of days the event stops working.

  • Is it possible that it being collected by the garbage collector (GC)?
  • Does the GC collect it holding class (which is a singleton)?
  • Should I use a weak event?
  • Do I have a bug that means the event gets unregistered?

What i think the problem is, that FSW has an internal buffer, when it overflows its an error, take a look in this article that offer code to solve this problem.
Hope this help anyone.

  • 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-23T19:35:54+00:00Added an answer on May 23, 2026 at 7:35 pm

    A couple of things to try, as suggested here:

    • In the timer tick event handler, stop your timer before doing your tick event handling, and restart it before exiting the handler
    • Wrap your timer code in a try/catch block to see what’s happening.
    • Read the Elapsed event of the System.Timers.Timer class is not raised in a Windows service bug description/fix and see if that helps you.

    In summary:

    protected virtual void TimerTick(object sender, EventArgs e)
    {
        // stop your timer
        this.timer.Stop();
    
        try
        {
            // TODO: add event handler specifics
        }
        catch
        {
            // TODO: add some logging to help you see what's going on
        }        
    
        // restart your timer
        this.timer.Start();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built one windows service that sends out email after every 30 minutes
I have written a Windows service that spawns a separate process. This process creates
I have an application that is built as a Windows Service and a c#
We have built a .NET Windows Service that we install on client PCs to
I am building a window service that monitor folders and transfer files(data with attachments)
I have a WCF Service (with installer) that I have built and installed in
We have built a Windows Service that is running on client's machines, which occasionally
I have built a windows service application in VB.net 2008, and used the Setup
I have a Windows service built upon ATL 7's CAtlServiceModuleT class. This service serves
I have built a windows C++ application that I'd like to port to linux.

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.