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

New Post: I want to create a schedule that will run every 1 hour in a day.

$
0
0
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.

Viewing all articles
Browse latest Browse all 2206

Trending Articles



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