Got IntelliSense for Unity and C# Working on Linux

I was thrilled to find out that I could do development with Unity on Ubuntu 18.04. I had decided to use VS Code as the C# script editor. However, I encountered a frustrating problemIntelliSense was broken – and I banged my head against a wall for a couple of hours because of it.

VS Code outputted the following error to the console:

The reference assemblies for framework ".NETFramework,Version=v3.5" 
were not found. To resolve this, install the SDK or Targeting Pack for 
this framework version or retarget your application to a version of the 
framework for which you have the SDK or Targeting Pack installed. Note that 
assemblies will be resolved from the Global Assembly Cache (GAC) and will be 
used in place of reference assemblies. Therefore your assembly may not be 
correctly targeted for the framework you intend.

I tried multiple things. I installed Mono with apt-get. I tried to install Mono from Homebrew. I changed the Unity .NET Framework version.  Nothing helped.

Then I came across this link. It resolved the issue in a simple way. I just had to install Mono development libraries. The commands were the following (for Ubuntu 18.04):

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF

echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list

sudo apt update

sudo apt-get install mono-devel

So, happy hacking ensued, and I finally got on with my project, with IntelliSense helping along the way!

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.