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

Commented Unassigned: A first chance exception of type 'System.InvalidCastException' occurred in Microsoft.Win32.TaskScheduler.dll [11900]

$
0
0
I'm getting this exception with this code:

```
Imports Microsoft.Win32.TaskScheduler

Public Sub GetAllTasks()
Using taskService As New TaskService
For Each task As Task In taskService.AllTasks
Using task
Debug.WriteLine(task.Definition.Settings.Priority)
End Using
Next
End Using
End Sub
```

I've tested and this occurs everytime i use the "Settings" namespace, even alone.
Although the property succeeds and no error is thrown back to my code (is handled by the dll) it would be nice for it to be fixed, if it's not intended.

Thanks for reading, searched for this library when P/ Invoke was burning my head.
Comments: ** Comment from web user: NotThisMind **

Yes, you are absolutely correct, thanks for this information, i tested now and it does exactly what you say, only "throws" on the first call for settings for each task.

I reported to be sure that this "error" wouldn't catch me up later in some release build, in that case, thanks again !
And good luck with further development.


Viewing all articles
Browse latest Browse all 2206

Trending Articles



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