Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug MonoDevelop: The name 'Dictionary' does not exist in the current context

Discussion in 'Linux' started by Keplyx, May 16, 2016.

  1. Keplyx

    Keplyx

    Joined:
    Apr 28, 2016
    Posts:
    5
    I'm using MonoDevelop 5.9.6, but each time I'm using a Dictionary, I get the error
    Code (CSharp):
    1. error CS0103: The name 'Dictionary' does not exist in the current context
    I did not forget the line
    Code (CSharp):
    1. using System.Collections.Generic;
    and Unity can run the script. What's annoying me is that I can't use auto-complete or debug and MonoDevelop is throwing errors everywhere.
    The IDE is saying "FrameWork Mono / .NET 3.5 is not installed", and doing "sudo apt-get install mono-reference-assemblies-3.5" changed nothing

    It's also happening for "Ienumerable" and "Ienumerator".

    I really don't know what to do, can somebody help me please?
     
    Last edited: May 16, 2016
  2. Keplyx

    Keplyx

    Joined:
    Apr 28, 2016
    Posts:
    5
    Found a fix! I had to install mono 2.0 and 4.0 by doing "sudo apt-get install mono-reference-assemblies-2.0" and
    "sudo apt-get install mono-reference-assemblies-4.0". Hope it will help anybody who gets that error!
     
    IgorAherne and malegretti like this.
  3. MorphVGX

    MorphVGX

    Joined:
    Jun 21, 2010
    Posts:
    60
    How do I do that? The weird thing is that I have other classes that use Dictionary and List and do not give any trouble.
     
  4. Wulfara

    Wulfara

    Joined:
    Aug 11, 2015
    Posts:
    40
    You probably don't need to because you may have the dependencies already installed by other application that needs them. I like to install the MonoDevelop package from my distro's official repository so I ensure that all the dependencies are installed even if I'm going to use the MonoDevelop integrated in Unity.
     
  5. MorphVGX

    MorphVGX

    Joined:
    Jun 21, 2010
    Posts:
    60
    I found the problem. A silly thing. I was declaring Dictionaries like this Dictionary<a>, instead of Dictionary<a,b> . =)