For example...
Dim taskServiceObject As New TaskScheduler.TaskService()
Dim taskObject As TaskScheduler.Task = taskServiceObject.GetTask("my task")
If taskObject IsNot Nothing Then
If taskObject.Definition.Settings.MultipleInstances <> TaskScheduler.TaskInstancesPolicy.Parallel Then
task.Definition.Settings.MultipleInstances = TaskScheduler.TaskInstancesPolicy.Parallel
task.RegisterChanges()
task.Dispose()
End If
End If
taskServiceObject.Dispose()
Some users reported the above exceptions. I have had to implement a work around for the issue.