'Async Tasks not found in Unity

I use system.threading.tasks library and this configuration:

Scripting Backend: IL2CPP API compatibility level: .NET Standard 2.1

but the project throws these errors:

error CS1983: The return type of an async method must be void, Task, Task, a task-like type, IAsyncEnumerable, or IAsyncEnumerator

In other projects, this library is working, so my pc has everything necessary installed. The problem only exists in the project.

I use unity 2021.3.1f1.

Any ideas?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source