【问题标题】:Is ISet not available in Mono?ISet 在 Mono 中不可用吗?
【发布时间】:2012-05-28 21:11:46
【问题描述】:

ISet Interface 在 Mono 中可用吗?好像没找到。

编辑:在 MonoDevelop 中将 Target Framework 设置为 4.0 后,我仍然收到错误消息:

错误 CS0246:找不到类型或命名空间名称 ISet。是 您缺少 using 指令或程序集引用?

任何使用 Mono 的人都可以确认ISet 是否适合他们吗?

【问题讨论】:

  • 您必须以 framework 4.0 为目标,ISet 接口才可用。
  • 我该怎么做?我正在使用 monodevelop 仅供参考。
  • 我刚刚将我的项目设置为指向 .NET - 但我仍然收到...: Error CS0246: The type or namespace name ISet could not be found. Are you missing a using directive or an assembly reference? (CS0246) (FooBar.API)
  • 首先你必须在 MonoDevelop 中定位 4.0 或更新的框架,其次检查你在项目引用中有系统程序集。
  • “检查您在项目引用中有系统程序集” - 我该怎么做?

标签: c# .net mono


【解决方案1】:

您必须以框架 4.0 为目标,ISet 接口才可用。

该接口位于 System.Collections.Generic 命名空间中,因此您需要指定全名System.Collections.Generic.ISet 或使用以下 using 语句:

using System.Collections.Generic;

根据Mono compatibility page,Mono 2.10.8 支持框架 4.0 中的所有内容,除了 WPF、EntityFramework 和 WF,WCF 的一部分。

【讨论】:

  • 我有 Runtime: Mono 2.10.8 并在我的项目中将 Target Framework 设置为 Mono .NET 4.0。如果我尝试使用ISet,仍然会出现错误。你能在你的身上试一试,看看它是否有效?谢谢!
  • @drozzy,我能够使用 MonoDevelop 定位 4.0,并且 ISet 可用。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多