Hi,
I upgraded to latest released dll in my project.
When I am trying to run below code on Win 8.1 OS it's giving error on below bold line:
Code:
TaskDefinition td = ts.NewTask();
td.Settings.RunOnlyIfLoggedOn = true;
Error:
NotV2SupportedException' was unhandled. An unhandled exception of type 'Microsoft.Win32.TaskScheduler.NotV2SupportedException' occurred in Microsoft.Win32.TaskScheduler.dll
The error is coming before registering the task and I am passing the password and task logon type while registering only.
ts.RootFolder.RegisterTaskDefinition(scheduleName.Text, td, TaskCreation.CreateOrUpdate, domainName + "\" + userName, password, TaskLogonType.Password, null);
Is there any workaround/example which I can refer to set "RunOnlyIfLoggedOn" property.
I upgraded to latest released dll in my project.
When I am trying to run below code on Win 8.1 OS it's giving error on below bold line:
Code:
TaskDefinition td = ts.NewTask();
td.Settings.RunOnlyIfLoggedOn = true;
Error:
NotV2SupportedException' was unhandled. An unhandled exception of type 'Microsoft.Win32.TaskScheduler.NotV2SupportedException' occurred in Microsoft.Win32.TaskScheduler.dll
The error is coming before registering the task and I am passing the password and task logon type while registering only.
ts.RootFolder.RegisterTaskDefinition(scheduleName.Text, td, TaskCreation.CreateOrUpdate, domainName + "\" + userName, password, TaskLogonType.Password, null);
Is there any workaround/example which I can refer to set "RunOnlyIfLoggedOn" property.