I keep getting a NotV1SupportedException when calling the RegisterChanges() function on a Task object.
This is the code that I'm using...
But if I use this code instead...
Theoretically speaking, both code examples should work but it isn't. Unless the .NET Framework is doing something wrong internally.
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.