Visual Studio 2010 Cannot Use System.Threading.Tasks;

12,150

Solution 1

Does your project target .NET 3.5 or lower, perhaps? System.Threading.Tasks was introduced in .NET 4 - just using Visual Studio 2010 isn't enough; you need to target the appropriate framework. (Fortunately it is in the .NET 4 client profile, which is often a little "gotcha" for some other types.)

Likewise Silverlight hasn't yet got the TPL, although IIRC it's coming in Silverlight 5.

Solution 2

Make sure that you are targeting .NET 4.0 in the properties of your project. TPL is not available in previous versions of .NET.

Share:
12,150
Ghassan
Author by

Ghassan

@goustabv88

Updated on June 04, 2022

Comments

  • Ghassan
    Ghassan almost 2 years

    I am trying to execute some processes in parallel. and it is my first time doing that, upon trying : using System.Threading.Tasks; Tasks will be underlined in red saying :

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

    how do i resolve that!?