相关疑难解决方法(0)

未定义或导入预定义类型'System.ValueTuple'2'

我安装了Visual Studio 15 Preview 3并尝试使用新的元组功能

static void Main(string[] args)
{
    var x = DoSomething();
    Console.WriteLine(x.x);
}

static (int x, int y) DoSomething()
{
    return (1, 2);
}
Run Code Online (Sandbox Code Playgroud)

当我编译时,我收到错误:

未定义或导入预定义类型'System.ValueTuple'2'

根据博客文章,这个功能默认情况下应该"打开".

我做错了什么?

c# c#-7.0 visual-studio-2017

362
推荐指数
4
解决办法
9万
查看次数

标签 统计

c# ×1

c#-7.0 ×1

visual-studio-2017 ×1