System.Threading.Tasks [英] System.Threading.Tasks

查看:71
本文介绍了System.Threading.Tasks的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用该引用.我知道它在c#4中.我不知道我现在有什么.

i am trying to use that reference. i know it is in c# 4. i don't know what i currently have.

但是基本上,当我写这行代码时:

but basically, when i write the line:

Task.Factory.StartNew(someMethod);

它告诉我这是一个错误.有什么方法可以解决这个问题,以便我的想法确定该库(任务并行库)吗?

it tells me that it is a mistake. is there any way to solve it so my ide will identify that library (Task Parallel Library)?

推荐答案

您只需要使用using指令

You just need a using directive of

using System.Threading.Tasks;

您不需要添加任何其他引用- Task 在mscorlib中.

You shouldn't need to add any extra references - Task is in mscorlib.

确定要定位.NET 4吗?签入您的项目属性. (可用的类型不取决于您使用的语言的版本,而是您使用的 framework 的版本.)

Are you sure you're targeting .NET 4? Check in your project properties. (The types available don't depend on the version of the language you're using, but the version of the framework you're using.)

这篇关于System.Threading.Tasks的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆