Compiling System.Tuple in Mono

二次信任 提交于 2019-12-24 11:29:32

问题


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?

How can I compile C# code using Mono that uses System.Tuple?


回答1:


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.)



来源:https://stackoverflow.com/questions/8014244/compiling-system-tuple-in-mono

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