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

I’m using MonoDevelop 5.9.6, but each time I’m using a Dictionary, I get the error

error CS0103: The name 'Dictionary' does not exist in the current context

I did not forget the line

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?

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!

2 Likes

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.

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.

I found the problem. A silly thing. I was declaring Dictionaries like this Dictionary, instead of Dictionary<a,b> . =)