Quantcast
Channel: Task Scheduler Managed Wrapper
Viewing all articles
Browse latest Browse all 2206

Created Unassigned: TaskDefinition.Actions.Count is still zero for XP [12305]

$
0
0
Hello,

I retested version 2.5.6 after closing issue 12303. I retested it and it is better now, but still not working properly in my case.

The example below has always been working on XP. The red line is used to remove all actions to make sure only 1 action is left after inserting the new one. The task is properly saved. But, reading the tasks will still give Definition.Actions.Count = 0 on XP.

Could you check this, please?

__Create task:__
```
Using ts As New TaskService()
' Create a new task definition and assign properties
Dim td As TaskDefinition = ts.NewTask
td.RegistrationInfo.Description = "Does something"

' Add a trigger that will, starting tomorrow, fire every other week on Monday
' and Saturday and repeat every 10 minutes for the following 11 hours
Dim wt As New WeeklyTrigger()
wt.StartBoundary = DateTime.Today.AddDays(1)
wt.DaysOfWeek = DaysOfTheWeek.Monday Or DaysOfTheWeek.Saturday
wt.WeeksInterval = 2
wt.Repetition.Duration = TimeSpan.FromHours(11)
wt.Repetition.Interval = TimeSpan.FromMinutes(10)
td.Triggers.Add(wt)

td.Actions.Clear()
td.Actions.Add(New ExecAction("notepad.exe", "c:\test.log"))

' Register the task in the root folder
ts.RootFolder.RegisterTaskDefinition("Test", td)
End Using
```

__Read Task:__
```
Dim AllTasks() As Task = ts.FindAllTasks(New System.Text.RegularExpressions.Regex("."), False)
For i As Integer = 0 To AllTasks.Length - 1
' AllTasks(i).Definition.Actions.Count is zero on XP for the just created task 'Test'
Next
```

Viewing all articles
Browse latest Browse all 2206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>