Mono : is there a System.Tuple?

老子叫甜甜 提交于 2019-12-01 17:35:07

Yes Mono supports a Tuple type. I know it's in 4.0 but I've seen comments of it's availability since version 2.6.

It also depends on what version of F# compiler do you use. If you compile your F# code using F# compiler for .NET 2.0, then it will use FSharp.Core.dll for .NET 2.0, which contains the declaration of Tuple<..> classes. Then you can simply reference FSharp.Core.dll from your C# project and you'll find tuple there (It is in the System namespace to make it compatible with .NET 4)

I believe that the ZIP release from Microsoft and the F# packages both contain 2.0 version. I'm not sure about the version of F# bundled with Mono 2.10 though or the one in Debian.

H27studio

I just tried

System.Tuple<int, int> t2 = new System.Tuple<int, int>(1, 2); 

and it worked, on version 4.0

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!