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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:14:05+00:00 2026-06-15T12:14:05+00:00

I have a VS 2012 project that has a timer that kicks off a

  • 0

I have a VS 2012 project that has a timer that kicks off a process every 2 minutes. It works fine but it seems to keep running after the project has been stopped. The only indication of this that I have is that it is logging errors to the database at the timer interval. Do I need to explicitly stop the timer? How is that done when you hit the stop button? When I close the project the logging stops.

The tick event (RefreshBroadcast) fails silently (when the app is not running) but the logging works fine, also the logging indicates that it does not have access to the config file as it uses the defaults (for application name etc). The logging code also is supposed to show the error in a View, so eventually Visual studio will tell me that my error view window “Does not have a resource identified by …”. This will happen with the project stopped, while I am coding somewhere else. After this the logging to the DB stops.

 Public Sub New()
        If Not System.Windows.Application.Current.MainWindow Is Nothing Then
            _refreshBroadcastTimer = New System.Windows.Threading.DispatcherTimer()
            AddHandler _refreshBroadcastTimer.Tick, AddressOf dispatcherTimer_Tick
            If Debugger.IsAttached Then
                _refreshBroadcastTimer.Interval = New TimeSpan(0, 0, 30)
            Else
                _refreshBroadcastTimer.Interval = New TimeSpan(0, 0, My.Settings.RefreshBroadcastIntervalMinutes * 60) ' change to seconds
            End If
            _refreshBroadcastTimer.Start()
        End If
    End Sub




Private Sub dispatcherTimer_Tick(sender As Object, e As EventArgs)
    Try
        RefreshBroadcast()
    Catch ex As Exception
        LogException(ex)
    End Try
End Sub
  • 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-15T12:14:06+00:00Added an answer on June 15, 2026 at 12:14 pm

    Its funny how asking a question often gives you the answer, this has been bugging me for days but I think I have it figured. Because i have the timer starting when the view model is newed up, whenever I open the View in the editor it creates an instance of the view model in the background and this starts off the timer. I guess i have to wrap the code so it does not fire in the designer.

    I have wrapped the init code in

     If Not System.ComponentModel.DesignerProperties.GetIsInDesignMode(New DependencyObject()) Then
    

    it seems to be working so far.

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

Sidebar

Related Questions

I have a Django project that has multiple django apps. One of them has
Visual Studio 2012, TFS, Windows 7 We have a C# solution that has 4
I have an ASP.NET MVC3 project that has a database. I want to attach
I have a RSS/Atom document that has a bunch of <entry> <title>project name</title> <link
I have a Django project that, on one page, has multiple forms (in different
I have a .nuspec file for my project, which references a third-party DLL that
I think this is something that you have come across. This has happened to
I'm working on an iPad project that uses a third-party SDK, and have been
We have one solution with multiple projects. One project has our entity model with
I have a project that was created in Blend + Sketchflow preview for Visual

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.