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

New Post: Very weird bug...

$
0
0
I keep getting a NotV1SupportedException when calling the RegisterChanges() function on a Task object.

This is the code that I'm using...
Using taskServiceObject As TaskScheduler.TaskService = New TaskScheduler.TaskService()
  Dim task As TaskScheduler.Task = taskServiceObject.GetTask("my task")

  If task IsNot Nothing Then
    ' Do some changes to the task here
    task.RegisterChanges()
    task.Dispose()
  End If
End Using
When it gets to the RegisterChanges() function it immediately crashes.

But if I use this code instead...
Dim taskServiceObject As New TaskScheduler.TaskService()
Dim task As TaskScheduler.Task = taskServiceObject.GetTask("my task")

If task IsNot Nothing Then
  ' Do some changes to the task here
  task.RegisterChanges()
  task.Dispose()
End If

taskServiceObject.Dispose()
It works just fine with no crash upon the call of RegisterChanges().

Theoretically speaking, both code examples should work but it isn't. Unless the .NET Framework is doing something wrong internally.

Viewing all articles
Browse latest Browse all 2206

Trending Articles



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