I am trying to execute some processes in parallel. and it is my first time doing that, upon trying : using System.Threading.Tasks; Tas开发者_如何学Pythonks 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!?
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.
Make sure that you are targeting .NET 4.0 in the properties of your project. TPL is not available in previous versions of .NET.
You have to change the Target Framework to 4.0
of your project.
Have you tried to add it by right clicking on add reference button in visual Studio?
精彩评论