Visual Studio 2010 cannot use System.Threading.Tasks;

I am trying to execute several processes in parallel. and this is the first time I am doing this while trying: using System.Threading.Tasks; Tasks will be underlined in red:

The Type or namespace name "Tasks" does not exist in the namespace System.Threading(are you missing an assembly reference?) 

how can i solve this !?

+4
source share
4 answers

Perhaps your project targets .NET 3.5 or lower? System.Threading.Tasks was introduced in .NET 4 - just using Visual Studio 2010 is not enough; you need to target the appropriate frames. (Fortunately, it is in the profile of the .NET 4 client, which is often a bit "received" for some other types.)

Similarly, Silverlight has not yet received the TPL, although IIRC it comes in Silverlight 5.

+7
source

Make sure you target .NET 4.0 with the properties of your project. TPL is not available in previous versions of .NET.

+2
source

You need to change the Target Framework to 4.0 your project.

0
source

Have you tried adding it by right-clicking the link to the link in visual Studio?

0
source

All Articles