Skip to content

The current version of the native library (1.4) does not support the original or minimum version of the ".NET Framework NGEN v4.0.30319" task (1.5/1.5) or task (1.6/1.6) #941

Closed

Description

@LeanderClappaert

Describe the bug
I want to add a scheduled task from a Windows Server 2012 R2 machine to a Windows Server 2016 and Windows 11 machine.
This is failing due to the error message below.
I've seen some similar issues passing by, but see the 'additional context' part where I have a case where this used to work.

Windows Server 2016:
The current version of the native library (1.4) does not support the original or minimum version of the ".NET Framework NGEN v4.0.30319" task (1.5/1.5). This is likely due to attempting to read the remote tasks of a newer version of Windows from a down-level client.

Windows 11:
The current version of the native library (1.4) does not support the original or minimum version of the ".NET Framework NGEN v4.0.30319" task (1.6/1.6). This is likely due to attempting to read the remote tasks of a newer version of Windows from a down-level client.

Expected behavior
I expect that the base machine, where you send a task from to another machine, can handle newer Task Library versions on that machine.

Environment (please complete the following information):

  • Host Windows version (the one running the code): Windows Server 2012R2
  • Library version: 2.10.1
  • Remote Windows version (if applicable): Windows Server 2016, Windows 11

Additional context
I used to work with 'Microsoft.Win32.TaskScheduler.dll' directly, version '2.4.2.0', and that works with the setup mentioned above, but there were some other issues that are resolved by using this library. So I'm hoping there is either a workaround or this bug can be resolved.

Update: some other changes that I did that maybe are related to this issue:

  • I set an Author and Date on the RegistrationInfo before registering this new task.
  • I loop over all the tasks of the root folder and delete tasks by author or if they do not have a 'next execution' time + the last run time was at least 1 day ago.

Activity

  1. LeanderClappaert commented on Apr 19, 2022

    @LeanderClappaert
    Author

    Update: the issue occurs due to these changes: "I loop over all the tasks of the root folder and delete tasks by author or if they do not have a 'next execution' time + the last run time was at least 1 day ago."

  2. LeanderClappaert commented on Apr 22, 2022

    @LeanderClappaert
    Author

    The issue was that I was using ts.RootFolder.AllTasks.Where(...).ToList() (ts == TaskService).
    I changed it to ts.FindAllTasks(...) and this works.
    Can be closed I guess?

  3. dahall commented on Apr 22, 2022

    @dahall
    Owner

    Thanks for all the detail. I'll do some testing to determine why your first scenario using the AllTasks property behaves differently. That doesn't seem right to me and maybe a bug.

  4. dahall commented on Apr 22, 2022

    @dahall
    Owner

    I found a bug that has been around for a long time when looking into your issue. Thank you. The next release of the library (2.10.2) will have identical behavior between the two methods you tried.

  5. bogdan-patraucean commented on Apr 27, 2024

    @bogdan-patraucean

    @dahall,, any idea when 2.10.2 might come? I encountered the same issue.

    System.InvalidOperationException: The current version of the native library (1.6) does not support the version of the "UpdateConfiguration_S-1-5-80-3238277391-1891473654-1195688043-4149050645-2494734967" task (0.0)
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址