question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Intellisense not working on Ubunutu 17.04 with Unity 5.

See original GitHub issue

Environment data

dotnet --info output:

Starting OmniSharp server at 10/31/2017, 11:38:30 AM
    Target: /home/tobias/Project/Unity/HorrorCam/HorrorCam.sln

OmniSharp server started wth Mono
    Path: /home/tobias/.vscode/extensions/ms-vscode.csharp-1.12.1/.omnisharp/run
    PID: 29701

OmniSharp: -s /home/tobias/Project/Unity/HorrorCam/HorrorCam.sln --hostPID 29604 --stdio DotNet:enablePackageRestore=false --encoding utf-8 --loglevel information formattingOptions:useTabs=false formattingOptions:tabSize=4 formattingOptions:indentationSize=4
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Startup","Message":"Omnisharp server running using Stdio at location '/home/tobias/Project/Unity/HorrorCam' on host 29604."},"Seq":1,"Type":"event"}
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Initializing in /home/tobias/Project/Unity/HorrorCam
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Auto package restore: False
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Update workspace context
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Resolving projects references
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Omnisharp will use local MSBuild.
    MSBUILD_EXE_PATH: /home/tobias/.vscode/extensions/ms-vscode.csharp-1.12.1/.omnisharp/omnisharp/msbuild/MSBuild.dll
    MSBuildExtensionsPath: /home/tobias/.vscode/extensions/ms-vscode.csharp-1.12.1/.omnisharp/omnisharp/msbuild
    TargetFrameworkRootPath: /usr/lib/mono/xbuild-frameworks
    RoslynTargetsPath: /home/tobias/.vscode/extensions/ms-vscode.csharp-1.12.1/.omnisharp/omnisharp/msbuild/Roslyn
    CscToolPath: /home/tobias/.vscode/extensions/ms-vscode.csharp-1.12.1/.omnisharp/omnisharp/msbuild/Roslyn

[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Detecting projects in '/home/tobias/Project/Unity/HorrorCam/HorrorCam.sln'.
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Loading project: /home/tobias/Project/Unity/HorrorCam/Assembly-CSharp.csproj
[fail]: OmniSharp.MSBuild.ProjectFile.ProjectFileInfo
        Cannot evaluate the item metadata "%(FullPath)". The item metadata "%(FullPath)" cannot be applied to the path "//mscorlib.dll". UNC paths should be of the form \\server\share.
[warn]: OmniSharp.MSBuild.MSBuildProjectSystem
        Failed to load project file '/home/tobias/Project/Unity/HorrorCam/Assembly-CSharp.csproj'.
/home/tobias/Project/Unity/HorrorCam/Assembly-CSharp.csproj

[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Loading project: /home/tobias/Project/Unity/HorrorCam/Assembly-CSharp-firstpass.csproj
[fail]: OmniSharp.MSBuild.ProjectFile.ProjectFileInfo
        Cannot evaluate the item metadata "%(FullPath)". The item metadata "%(FullPath)" cannot be applied to the path "//mscorlib.dll". UNC paths should be of the form \\server\share.
[warn]: OmniSharp.MSBuild.MSBuildProjectSystem
        Failed to load project file '/home/tobias/Project/Unity/HorrorCam/Assembly-CSharp-firstpass.csproj'.
/home/tobias/Project/Unity/HorrorCam/Assembly-CSharp-firstpass.csproj

[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Loading project: /home/tobias/Project/Unity/HorrorCam/Assembly-CSharp-Editor.csproj
[fail]: OmniSharp.MSBuild.ProjectFile.ProjectFileInfo
        Cannot evaluate the item metadata "%(FullPath)". The item metadata "%(FullPath)" cannot be applied to the path "//mscorlib.dll". UNC paths should be of the form \\server\share.
[warn]: OmniSharp.MSBuild.MSBuildProjectSystem
        Failed to load project file '/home/tobias/Project/Unity/HorrorCam/Assembly-CSharp-Editor.csproj'.
/home/tobias/Project/Unity/HorrorCam/Assembly-CSharp-Editor.csproj

[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/home/tobias/Project/Unity/HorrorCam'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.Services.WorkspaceHelper
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.Startup
        Configuration finished.

VS Code version: 1.17.2 C# Extension version: 1.12.1

Already tried

  • Updating Mono to latest
  • Updating OmniSharp
  • Removing all .csproj and .sln files to get newly generated ones

Steps to reproduce

  1. Open Unity Editor (latest Linux version)
  2. Open C# Project
  3. See errors in output log

Expected behavior

No errors and intellisense to work for Unity 5.

Actual behavior

I get several errors and I don’t have any Unity intellisense.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
brogan89commented, Dec 3, 2017

@badersur I installed Ubuntu 17.10 fresh without updating yea. I using version 1.13.1 extension

I didn’t do anything special really.

  • Installed vscode from https://code.visualstudio.com/Download
  • Installed mono complete sudo apt-get install mono-complete. I cant remember why I needed that, but i remember it wasn’t working and on the mono website it states The package mono-complete should be installed to install everything - this should cover most cases of "assembly not found" errors. So i tried it and it worked.
  • Installed C# for Visual Studio Code (powered by OmniSharp), Debugger for Unity, Unity Tools, Monobehaviour Snippets in the extensions tab in vscode. (thats pretty much all you need)
  • Installed vscode asset from Unity Asset Store https://www.assetstore.unity3d.com/en/#!/content/45320. I found I needed this for linux only, didn’t need it for windows which was interesting. But it helped point console logs to the correct line in code. Without it, it would only open up the correct file but not point to the correct line. I said above I didn’t need it, but I was wrong lol.

That’s it, and it works perfectly, I use vscode from work (windows) and from home (linux) with unity with no issues at all. Hope that helped you out.

2reactions
ywabycommented, Jan 4, 2018

fix by install newest version package from mono office(debian 9 repository)

Read more comments on GitHub >

github_iconTop Results From Across the Web

[SOLVED] Unity with VS Code and intellisense on Linux Mint
I found one: VS Code I did these steps to make it work with Itellisense in Linux Mint 20 Cinnamon (son of Ubuntu...
Read more >
Cant Get Intellisense To Work With Unity, Using Vscode ...
1. Go to Edit/Preferences. 2. Click on External Tools 3. Under where it says Generate. 4. Click the Regenerate project files button 5....
Read more >
Newest 'unity3d' Questions - Ask Ubuntu
I am using Ubuntu 17.04 and I am trying to install unity 3d on it but after finishing the process it's not in...
Read more >
How to install Visual Studio Code 1.19 on Ubuntu 17.04, 17.10
Serviceability/Diagnostics - New VS Code diagnostics, logging, and extension monitoring. Smarter IntelliSense - IntelliSense remembers your ...
Read more >
How to use xRDP for remote access to Ubuntu 14.04
Installing xRDP and XFCE · Step 1 – Install xRDP · Step 2 – Install XFCE4 · Step 3 – Configure xRDP ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found