【问题标题】:error cs0103 The Name 'IEnumerator' does not exist in the current context错误 cs0103 当前上下文中不存在名称“IEnumerator”
【发布时间】:2015-12-21 05:58:07
【问题描述】:

我在 monodevelop 统一工具中的 C# 开发中遇到问题。 在很多方法和接口中找不到像IEnumeratorArray.Length

我找到了Same question ,但它不适合我。 因为该问题的解决方案是导入 System.Collections 命名空间,但我已经导入了它,然后也会引发编译时错误。 我已在 Windows 8.1 操作系统上安装了最新的 .Net Framework。

我如何解决这个问题?

【问题讨论】:

  • 您似乎缺少一些 .not ddls
  • 但是如何更新它的 DLL 文件?

标签: c# unity3d monodevelop


【解决方案1】:

我以前也遇到过这个问题。我使用的是最新的 .net 框架,然后我转到控制面板中的程序和功能(如果您使用的是 Windows)并选择该框以同时运行 .net 框架 3.5 我认为是。

然后我在保存后关闭了我的项目,重新启动了我的机器,它工作正常

【讨论】:

  • IEnumerator 在 System.Collections 中,而 IEnumerator 在 System.Collections.Generic 中。所以请确保你有正确的匹配。
【解决方案2】:

通过右键单击从 MonoDevelop 关闭项目。并在 MonoDevelop 中手动打开 *.sln 文件

【讨论】:

    【解决方案3】:

    我正在使用 Debian,我遇到了您的错误,this error,并且通过安装这些软件包修复了这两个错误:

    mono-reference-assemblies-2.0
    mono-reference-assemblies-3.5
    

    使用 APT:

    sudo apt install mono-reference-assemblies-2.0 mono-reference-assemblies-3.5
    

    【讨论】:

      猜你喜欢
      • 2019-01-05
      • 2021-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多