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

Commented Issue: NotV1SupportedException while creating a folder [12450]

$
0
0
Hi

Getting NotV1SupportedException when creating a folder.

__Here's the stack trace:__

Microsoft.Win32.TaskScheduler.NotV1SupportedException: MyClass.createTask is not supported on Task Scheduler 1.0
at Microsoft.Win32.TaskScheduler.TaskFolder.CreateFolder(String subFolderName, String sddlForm, Boolean exceptionOnExists)


__Code:__

td.Actions.Add(new ExecAction(scheduleExePath, scheduleId));

TaskFolder tf = ts.RootFolder;
TaskFolder testFolder = null;
foreach (TaskFolder taskFolder in tf.SubFolders)
{
if (taskFolder.Name.Equals("ReportSchedule", StringComparison.OrdinalIgnoreCase))
{
testFolder = taskFolder;
}
}
if (testFolder == null)
testFolder = tf.CreateFolder("MyFolder");
__Environment:__
OS: Windows 10 / Windows 2012
Visual Studio 2013
.NET Framework 4.5.1
Task Scheduler Version: Release 2.5.21

Kindly advice, is there anything I am doing wrong?

Thanks
Mani
Comments: ** Comment from web user: vdmani **

Hi dahall,

Thanks a lot for the resolution.


Though, I haven't explicitly set forceV1 to true, it was in the initialization line.

TaskService ts = new TaskService(server, userName, domain, Password, __true__)

Thanks
Mani


Viewing all articles
Browse latest Browse all 2206

Trending Articles



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