System.Threading.Tasks 1' does not exist in the namespace 'System.Threading.Tasks'

What’s up guys?

First of all, sorry for my bad english, not a native speaker here.

I tried to use the .Net-Framework in connection with unity and found out, that including the Tasks.dll in unity showed the error message above. I wrote the code in Visual Studio and added the assembly reference for System.Threading.Tasks. After some research I found out, that I had to change the target to .Net 4 and added the Tasks.dll to the plugin folder of unity.

After that, I got stuck with the error message above. I already saw the posts:

but it either didn’t help or I didn’t fully understand.

So if anyone’s up for some good ideas, it would help so much.

Unity uses an old version of the Mono Runtime ( .Net 2.0). Asynchronous methods (async/await, System.Threading.Tasks) has been introduce since .Net 4.5, so this feature simply does not currently exists in Unity. Updating the Mono Runtime is nonetheless on the development roadmap, but without no shipping date.

You might be interested by the following thread, which is a discussion about updating to C# 6.0:

AI Scripting - Panda BT: Behaviour Tree scripting for Unity.