This project has moved. For the latest updates, please go here.

Recurring triggers and compile errors

Coordinator
Sep 9, 2011 at 6:38 PM

Captured from Comments on Examples Page - Moved here for better visibility

jmealing3 Thu at 8:29 PM
Great looking package, thanks.
Question: How do I schedule a task to run at uniform intervals? I see how to set the start time and the end time for the process being started, but I want to have a process that re-schedules itself at regular intervals.
More examples and better descriptions would be greatly appreciated (not everyone is as strong a C# and OO programmer as you).
Also, I expected the notepad example to actually run notepad - it doesn't seem to do anything. I think that I'm missing some understanding of how the TaskScheduler is supposed to work

dahall Thu at 11:38 PM
See the TimeTrigger section of the "Complex Example" above for an example of how to setup a recurring trigger on an interval. I'll look to improve the examples and descriptions. For the examples, notepad should actually run if the triggers and the task are all enabled.

jmealing3 Today at 1:24 PM
Thanks for the pointer. Just tried to build the editor and it would not compile. Couldn't find the TaskEditDialog. I have added references to all the dlls in the TaskScheculer and Editor but the compiler (VS 2010) cannot find the dialog. What am I missing? Also, every example ends by removing the task. Why and where should I look to find the registered task(s)? I commented out that line and still cannot find the task register file. The root directory come back as "\", b ut I've looked everywhere and still cannot find the file. Thanks for your help one this.

jmealing3 Today at 2:48 PM
Some good news: The notepad task did finally run: way late, but it ran.
Environment: .Net 4, VS 2010 Ultimate, WinXP SP3
More problems: I downloaded the source code and only the COMTask would build. Here are the error messages from the TaskEditor:

Error 727 'AeroWizard.WizardPage' does not contain a definition for 'Suppress' and no extension method 'Suppress' accepting a first argument of type 'AeroWizard.WizardPage' could be found (are you missing a using directive or an assembly reference?) D:\Downloads\TaskScheduler\taskscheduler-70200\TaskService\TaskEditor\TaskSchedulerWizard.cs 868 9 TaskEditor

From TestTaskService 17 errors, first one shown:
Error 605 'Microsoft.Win32.TaskScheduler.TaskSchedulerWizard' does not contain a definition for 'AvailablePages' and no extension method 'AvailablePages' accepting a first argument of type 'Microsoft.Win32.TaskScheduler.TaskSchedulerWizard' could be found (are you missing a using directive or an assembly reference?) D:\Downloads\TaskScheduler\taskscheduler-70200\TaskService\TestTaskService\Program.cs 192 10 TestTaskService

jmealing3 Today at 4:19 PM
Got some more information that might help: I'm running Win XP SP3, but behind on updates (lots of them). When I built the Complex example, I found that I have only V1.1 of TaskScheduler. While this won't fix everything, it might reduce the problems somewhat. Any idea where to get V 2?

I will be installing the updates today, hoping that V2 comes in, but the list of updates does not show V2 explicitly. Is there some place that I can get it? MS downloads don't show it anywhere. Thanks in advance.

jmealing3 Today at 5:10 PM
Still more info: Task scheduler doesn't run on XP. My bad!
ComplexTaskSample doesn't compile: line 185 throws an exception. It shouldn't, but it does - at least on my machine. The line is:
MonthlyDOWTrigger mdTrigger = (MonthlyDOWTrigger)td.Triggers.Add(new MonthlyDOWTrigger());

Coordinator
Sep 10, 2011 at 2:51 AM

To compile the solution: You will need to look in the projects at the references and make sure the corresponding assemblies from the current download are in those locations. You don't really need to compile the solution. You should be able to just pull the assemblies from the download section and then reference them in your code. To make this really easy, I would recommend installing NuGet (nuget.org) and using it to pull in the references you need. The base library is available as "Task Scheduler Managed Wrapper". This will work for all programmatic access to tasks. If you need UI elements in your code to give the users the ability to manipulate tasks then also include "Task Scheduler Managed Wrapper UI library". The nice thing about NuGet is that it adds the references and all dependencies for you and then will alert you whenever there are updates.

V2: The V2 version of the library is only available on Vista/Server 2008 and later. You cannot get it for XP or Server 2003. XP and earlier have a "Tasks" item in Control Panel to view the current tasks.

Sep 12, 2011 at 6:03 PM

Thanks for all your help. Got Wizard running, my bad. NuGet is smooth, thanks for the pointer.

Looking forward to 1.6.4 so that DOW trigger works.

Sep 13, 2011 at 4:56 PM

Wrote a simple task scheduler to run a task at 5 minute intervals for 30 minutes using TimeTriggerEndBoundry. Set the TimeTriggerRepetition.Duration to 4 hours. Set StopAtDurationEnd to true.

After 1.5 hours, it is still running. It looks like the Duration overrides the EndBoundry - or am I missing something again?

Thanks for the help.

Coordinator
Sep 13, 2011 at 9:47 PM

EndBoundary has no effect on the time a task is allowed to run. StopAtDurationEnd will kill the task at the end of the time.