Hor*_*2.0 1 c# visual-studio-code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Task;`
`namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World");
Console.ReadLine();
}
}
}
Run Code Online (Sandbox Code Playgroud)
我只是想开始使用C#,当我编写helloworld时,我遇到了第一个编译错误.
错误:脚本编译失败.[CompilationErrorException]错误CS0234:名称空间'System.Threading'中不存在类型或命名空间名称'Task'(您是否缺少程序集引用?)
我在VScode中运行最新的.NET编辑.希望得到你的帮助.
你在System.Threading.Tasks中寻找任务吗?
注意最后的's'.
完整的参考是System.Threading.Tasks.Task,或用于使用,System.Threading.Task 小号.