Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
LeanderClappaert opened this issue Apr 19, 2022 · 5 comments

Comments

@LeanderClappaert
Copy link

LeanderClappaert commented Apr 19, 2022

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.
@LeanderClappaert
Copy link
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."

@LeanderClappaert
Copy link
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?

@dahall
Copy link
Owner

dahall commented Apr 22, 2022

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.

dahall added a commit that referenced this issue Apr 22, 2022
…in both files around that better functioning method (#941). Also cleaned and optimized code.
@dahall
Copy link
Owner

dahall commented Apr 22, 2022

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.

@bogdan-patraucean
Copy link

bogdan-patraucean commented Apr 27, 2024

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants