C# 找不到类型或命名空间任务
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19636990/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
type or namespace Task could not be found
提问by Aju
I'm using Microsoft Visual Studio express for windows phone, when i use TASK in my app, i get the above mentioned error, even System.Threading.Tasks is also not found. What could be my problem??
我在 Windows 手机上使用 Microsoft Visual Studio express,当我在我的应用程序中使用 TASK 时,我收到上述错误,甚至 System.Threading.Tasks 也未找到。什么可能是我的问题?
采纳答案by Igor ?evo
You need to target at least .NET Framework 4 in your project. You can change this under project properties.
您需要在项目中至少面向 .NET Framework 4。您可以在项目属性下更改此设置。
Also, changing the target will not add the reference for the library, so you have to do this manually after changing the target framework.
此外,更改目标不会添加库的引用,因此您必须在更改目标框架后手动执行此操作。
回答by Luqman
On WP8 (test device Lumia 920), my problem is resolved by following the instructions at: http://www.nuget.org/packages/Microsoft.Bcl.Async
在 WP8(测试设备 Lumia 920)上,按照以下说明解决了我的问题:http: //www.nuget.org/packages/Microsoft.Bcl.Async
回答by Volstok
Right click on Task, choose Resolve > System.Threading.Tasks.Task
右键单击任务,选择解决 > System.Threading.Tasks.Task