在 Mono 中编译 System.Tuple [英] Compiling System.Tuple in Mono
问题描述
我正在尝试使用包含 System.Tuple 的 gmcs 2.11.0 版编译一些 C#.据说它确实存在于 Mono (http://stackoverflow.com/questions/5346453/mono-is-there-a-system-tuple) 中,并且可以使用该标志进行编译:
I'm attempting to compile some C# with gmcs version 2.11.0 that includes System.Tuple. Supposedly it does exist in Mono (http://stackoverflow.com/questions/5346453/mono-is-there-a-system-tuple) and it is possible to compile using the flag:
gmcs -langversion:future
我使用哪个语言版本似乎无关紧要,编译器总是给出相同的错误:
It doesn't seem to matter which langversion I use, the compiler always gives the same error:
error CS0234: The type or namespace name `Tuple' does not exist in the namespace `System'. Are you missing an assembly reference?
如何使用使用 System.Tuple 的 Mono 编译 C# 代码?
How can I compile C# code using Mono that uses System.Tuple?
推荐答案
我认为问题在于 gmcs
面向与 .NET 3.5 等效的 Mono 框架版本.您可以要么尝试说服 gmcs 以等效于 .NET 4 的 Mono 框架版本为目标,或者您可以改用 dmcs
.(即使使用我希望可以工作的 gmcs -sdk:4
,我也无法让它工作,所以 dmcs
可能是一个更好的选择.)
I believe the problem is that gmcs
targets the Mono framework version equivalent to .NET 3.5. You could either try to persuade gmcs to target the Mono framework version equivalent to .NET 4, or you could use dmcs
instead. (I couldn't get it to work even with gmcs -sdk:4
which I expected to work, so dmcs
may be a better bet.)
这篇关于在 Mono 中编译 System.Tuple的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!