I've recently finished creating a WPF application where I used the InstallShield Limited Edition Project for the setup and deplotment, to create an exe file. This was done so I could install it where it was needed, however I have run into a snag shortly after installing the program on another PC. The program is installed correct (I believe), but I've run into the problem that the timer I am using. (System.Timers.Timer) is not firing and/or working on these other PC's that are not development PC's (Ie. does not have VS15/17). The program only works when used on a Development PC.
I've tried to figure out why it wouldnt work and I've not been able to figure out what they are missing for them to work. Both the PC's have the Microsoft Frameworks they should (4.5 and above), so I've run out of ideas.
This line is placed inside the constructor for the MainWindow
crashCheckTimer = new System.Timers.Timer(_waitTime);
The SetTimer method
private void SetTimer(bool start)
{
// Hook up the Elapsed event for the timer.
try
{
crashCheckTimer.Enabled = start;
crashCheckTimer.AutoReset = true;
crashCheckTimer.Elapsed += CrashCheckEvent;
}
catch (Exception ex)
{
logBuilder.ErrorLogCreation(ex, DateTime.Now, "SetTimer", NumberOfFilesToKeep);
throw;
}
}
The CrashCheckEvent just runs some code, but is never called on the non dev pc's
Update: I changes the Timers.Timer to Dispatcher.Timer on the advice of a co-worker and that have seemingly fix my issue with getting the timer to fire again.