peass-ng/PEASS-ng · error · InvalidOperationException
The current version of the native library (1.{osLibMinorVer}
Error message
The current version of the native library (1.{osLibMinorVer}) does not support the original or minimum version of the "{iTask.Name}" task ({xmlVer}/1.{newMinor}). This is likely due to attempting to read the remote tasks of a newer version of Windows from a down-level client. What it means
When reading a task's XML definition, the library computes the minimum Task Scheduler version the definition requires. If that required minor version exceeds what the local native library (1.{osLibMinorVer}) supports and throwError is set, it throws InvalidOperationException — typically when enumerating tasks created on a newer Windows version from a down-level client (e.g. Win7 reading Win10 tasks).
Source
Thrown at winPEAS/winPEASexe/winPEAS/TaskScheduler/Task.cs:1635
!dd.Contains("Source") &&
!dd.Contains("URI") &&
!dd.Contains("AllowStartOnDemand", "true", true) &&
!dd.Contains("AllowHardTerminate", "true", true) &&
!dd.Contains("MultipleInstancesPolicy", "IgnoreNew", true) &&
!dd.Contains("NetworkSettings") &&
!dd.Contains("StartWhenAvailable", "false", true) &&
!dd.Contains("SendEmail") &&
!dd.Contains("ShowMessage") &&
!dd.Contains("ComHandler") &&
!dd.Contains("EventTrigger") &&
!dd.Contains("SessionStateChangeTrigger") &&
!dd.Contains("RegistrationTrigger") &&
!dd.Contains("RestartOnFailure") &&
!dd.Contains("LogonType", "None", true))
newMinor = 1;
if (newMinor > osLibMinorVer && throwError)
throw new InvalidOperationException($"The current version of the native library (1.{osLibMinorVer}) does not support the original or minimum version of the \"{iTask.Name}\" task ({xmlVer}/1.{newMinor}). This is likely due to attempting to read the remote tasks of a newer version of Windows from a down-level client.");
if (newMinor != xmlVer.Minor)
{
dd.Version = new Version(1, newMinor);
var def = svc.v2TaskService.NewTask(0);
def.XmlText = dd.Xml;
return def;
}
}
return iTask.Definition;
}
catch (COMException comEx)
{
if (throwError)
{
if ((uint)comEx.ErrorCode == 0x80041318 && xmlVer.Minor != osLibMinorVer) // Incorrect XML value
throw new InvalidOperationException($"The current version of the native library (1.{osLibMinorVer}) does not support the version of the \"{iTask.Name}\" task ({xmlVer})");
throw;View on GitHub (pinned to 53fb989abc)
Solutions
- Run the enumeration from a client OS at least as new as the machine that registered the tasks
- Use TaskService.Connect with matching OS versions, or upgrade the client to Windows 10+
- Set throwError=false to skip/adjust unsupported tasks instead of throwing
- Downgrade the offending task's XML version manually (the library attempts to trim unsupported features)
Example fix
// before
foreach (var t in remoteFolder.Tasks) Console.WriteLine(t.Definition.XmlText);
// after
foreach (var t in remoteFolder.GetTasks(throwError: false))
Console.WriteLine(t.Definition.XmlText); Defensive patterns
Strategy: try-catch
Validate before calling
if (newMinor > osLibMinorVer)
Console.WriteLine($"Task {taskName} requires v1.{newMinor}; local library supports 1.{osLibMinorVer}"); Try / catch
try { EnumerateTasks(folder); }
catch (InvalidOperationException ex) when (ex.Message.Contains("native library"))
{ /* skip task or re-run from a newer client */ } Prevention
- Enumerate remote tasks from a client OS of equal or newer version than the server
- Use throwError:false when enumerating heterogeneous environments
- Keep client and remote Windows versions aligned
When it happens
Trigger: Enumerating/connecting to a task store whose tasks were registered with features newer than the client's native library supports; a task XML requiring version 1.{newMinor} while the client is 1.{osLibMinorVer} with newMinor > osLibMinorVer.
Common situations: Remote task enumeration from an older OS to a newer one (Win7 client → Win10 server); tasks using newer triggers/settings unavailable in older Task Scheduler; migrating task definitions between machines.
Related errors
- The current version of the native library (1.{osLibMinorVer}
- Task Scheduler 2.0 (1.2) does not support setting this prope
- A maximum of 32 actions is allowed within a single task.
- Attachments array cannot contain more than 8 items.
- Each value of the array must contain a valid file reference.
AI-assisted analysis of peass-ng/PEASS-ng@53fb989abc (2026-09-02).
Data as JSON: /api/errors/089b9758ab209401.
Report an issue: GitHub.