Describe the bugSystem.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Win32.TaskScheduler.V2Interop.ITaskSettings3'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{0AD9D0D7-0C7F-4EBB-9A5F-D1C648DCA528}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)). at Microsoft.Win32.TaskScheduler.TaskSettings..ctor(Microsoft.Win32.TaskScheduler.V2Interop.ITaskSettings iSettings) at offset 36
To Reproduce
On Windows 7, ITaskSettings3 interface doesn't exist; this only exists on Windows 8 and higher. If you create a task like this: TaskService.Instance.NewTask(), the above exception is thrown on W7. This is catched here, but this exception can be avoided on W7 by checking whether the system is running on Windows 8 or higher. Otherwise this continues to show up when logging all exceptions.
Describe the bug
System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Win32.TaskScheduler.V2Interop.ITaskSettings3'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{0AD9D0D7-0C7F-4EBB-9A5F-D1C648DCA528}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)). at Microsoft.Win32.TaskScheduler.TaskSettings..ctor(Microsoft.Win32.TaskScheduler.V2Interop.ITaskSettings iSettings) at offset 36
To Reproduce On Windows 7, ITaskSettings3 interface doesn't exist; this only exists on Windows 8 and higher. If you create a task like this:
TaskService.Instance.NewTask()
, the above exception is thrown on W7. This is catched here, but this exception can be avoided on W7 by checking whether the system is running on Windows 8 or higher. Otherwise this continues to show up when logging all exceptions.