Sep 7, 2011 at 2:08 PM
Edited Sep 7, 2011 at 2:11 PM
I got the following exception when I tried to run the FindTask function:
System.ArgumentException: Value does not fall within the expected range.
at Microsoft.Win32.TaskScheduler.TaskFolderCollection.CopyTo(TaskFolder array, Int32 arrayIndex) at Microsoft.Win32.TaskScheduler.TaskFolderCollection.GetEnumerator() at Microsoft.Win32.TaskScheduler.TaskService.FindTaskInFolder(TaskFolder
fld, Regex taskName, Boolean recurse) at Microsoft.Win32.TaskScheduler.TaskService.FindTask(String name, Boolean searchAllFolders)
This is the code I used to run that function:
TaskService taskService = new TaskService();
var existingTask = taskService.FindTask("TestTask");
I'm using the 1.6.0 version of TaskScheduler.
The TaskScheduler worked perfectly until today, on all sort of operation systems. This is the first time we got this exception and its consistent.
the operation system is: Windows Server 2003 R2 Standard Ed. SP2
Please let me know if you have any ideas.
Thanks in advanced,