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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more..
    Dismiss Notice
  3. Dismiss Notice

MonoDevelop can't find List or Dictionary

Discussion in 'Scripting' started by AlexBecks27, Aug 8, 2017.

  1. AlexBecks27

    AlexBecks27

    Joined:
    Aug 8, 2017
    Posts:
    4
    I'm using Unity 2017.1.0f3 and MonoDevelop 5.9.6 and I recently updated the scripting runtime version from default (3.5) to 4.6.

    Since then when I try to use a List or a Dictionary it doesn't recognize them and mark them as error with the following message: "The name 'List/Dictionary' does not exist in current context".

    I can use other classes of the same namespace, like SortedDictionary without any problem, and the script works fine even using List or Dictionary but it's annoying because it seems wrong and I can't use autocomplete.

    What could be the problem?
     
  2. bigmisterb

    bigmisterb

    Joined:
    Nov 6, 2010
    Posts:
    4,221
    Code (csharp):
    1.  
    2. using System.Collections.Generic;
    3.  
     
  3. AlexBecks27

    AlexBecks27

    Joined:
    Aug 8, 2017
    Posts:
    4
    @bigmisterb
    I have that line at the beginning of the script, as I said it works fine in Unity and I can use other classes of the same namespace.
     
  4. Fab-London

    Fab-London

    Joined:
    Feb 6, 2013
    Posts:
    35
    I have the same issue, nothing to do with the next space, it is almost like if monodevelop is compatible with 4.6
     
  5. fjahgo

    fjahgo

    Joined:
    Apr 19, 2012
    Posts:
    11
    This is happening to me too at the moment. I have been googling for several minutes without finding a solution. What is this, 2015?
     
  6. bigmisterb

    bigmisterb

    Joined:
    Nov 6, 2010
    Posts:
    4,221
    test bed seems to support dictionary...

    Code (csharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class Test : MonoBehaviour {
    6.     // Update is called once per frame
    7.     void Update () {
    8.         var d = new Dictionary<string, string> (){
    9.             { "test1", "Something here" },
    10.             { "test2", "Something there" }
    11.         };
    12.     }
    13. }
     
  7. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,196
    MonoDevelop probably didn't get the memo that you updated the runtime version, and got confused.

    Stop using MonoDevelop, it's garbage. If that's not an option, close Unity/MD, delete your .sln and .csproj files, open Unity, and then open scripts. That should fix things.
     
    MadeFromPolygons likes this.
  8. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,877
    This. get VS Code, install the Unity and C# plugins as well as icon plugins, core sdk etc. Enjoy life with proper debugging, support and no more **** crashes. also you can copy and paste all the time into it, none of the horrible monodevelop bugs. Also its a fraction of the size and opens 4x faster.