spacecodeur
spacecodeur

Reputation: 2406

Unity3D on Ubuntu 19.10 with vscode and C# extension : get an error and the autocomplete doesn't working

I'm a web developer (symfony <3 ;) C# and microsoft technologies are new for me ! ) and during the covid containment I want create a simple game with the game engine unity

On Ubuntu 19.10, I downloaded unity Hub v2.3.0 (https://unity3d.com/get-unity/download)

From unity hub, I installed unity3D v2019.3.7f1 (the lastest stable) with some options (Linux & WebGL & windows build support)

enter image description here

And I created a simple 2D game

enter image description here

All works like a charm, I can open my project and run my new game without any error in the unity3D console

From Unity, when I create a c# script, the file can be opened by my (very simple) text editor gedit. Now I want to install the cross-os IDE visualcode thanks thats I'll get some usefull extensions and autocompletion code when I'll edit my unity scripts.

So, I installed vscode via apt install (I followed this official guide : https://code.visualstudio.com/docs/setup/linux)

My version of vscode is :

enter image description here

After some web search, I understand I must install the .NET framework (maybe I'm wrong ?)

enter image description here

My dotnet version (from a terminal : dotnet --version) is 3.1.201

Next I configured the unity parameter for change the default text editor :

enter image description here

I created a simple c# script from unity, I opened the file and vscode opened automatically (yeah !). And from vscode I added two public variables (the bool 'a' and the Rigidbody2D 'b')

enter image description here

I saved my script and go to unity app, the variables a and b are visible on the interface :

enter image description here

All works ! But now, I want have the autocomplete code from vscode. So, I installed the vscode c# extensions. But when the installation finished, this message appears :

enter image description here

The whole of log is :

Starting OmniSharp server at 4/2/2020, 8:10:51 PM
    Target: /home/okli/UnityProjects/SampleGame/SampleGame.sln

OmniSharp server started.
    Path: /home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/run
    PID: 15372

[info]: OmniSharp.Stdio.Host
    Starting OmniSharp on ubuntu 19.10 (x64)
[info]: OmniSharp.Services.DotNetCliService
    DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
    Located 1 MSBuild instance(s)
        1: StandAlone 16.4 - "/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
    MSBUILD_EXE_PATH environment variable set to '/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/MSBuild.dll'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
    Registered MSBuild instance: StandAlone 16.4 - "/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin"
        CscToolExe = csc.exe
        MSBuildToolsPath = /home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin
        CscToolPath = /home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Roslyn
        BypassFrameworkInstallChecks = true
        MSBuildExtensionsPath = /home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild
[info]: OmniSharp.Cake.CakeProjectSystem
    Detecting Cake files in '/home/okli/UnityProjects/SampleGame'.
[info]: OmniSharp.Cake.CakeProjectSystem
    Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
    Detecting projects in '/home/okli/UnityProjects/SampleGame/SampleGame.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
    Queue project update for '/home/okli/UnityProjects/SampleGame/Assembly-CSharp.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
    Detecting CSX files in '/home/okli/UnityProjects/SampleGame'.
[info]: OmniSharp.Script.ScriptProjectSystem
    Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
[info]: OmniSharp.WorkspaceInitializer
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200
[info]: OmniSharp.WorkspaceInitializer
    Configuration finished.
[info]: OmniSharp.Stdio.Host
    Omnisharp server running using Stdio at location '/home/okli/UnityProjects/SampleGame' on host 14406.
[info]: OmniSharp.MSBuild.ProjectManager
    Loading project: /home/okli/UnityProjects/SampleGame/Assembly-CSharp.csproj
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.Timeline.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.Animation.Runtime.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.PixelPerfect.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.VSCode.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.SpriteShape.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.TextMeshPro.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.Path.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'UnityEngine.UI.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.Timeline.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.Animation.Triangle.Runtime.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'PsdPlugin.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.CollabProxy.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.Rider.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.Mathematics.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.Psdimporter.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.InternalAPIEngineBridge.001.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.Sprite.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.Common.Runtime.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.Tilemap.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.SpriteShape.Runtime.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.PixelPerfect.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.Animation.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.Mathematics.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.TextMeshPro.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.Common.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.InternalAPIEditorBridge.001.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'UnityEditor.UI.csproj' does not exist.
[fail]: OmniSharp.MSBuild.ProjectLoader
    The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
[warn]: OmniSharp.MSBuild.ProjectManager
    Failed to load project file '/home/okli/UnityProjects/SampleGame/Assembly-CSharp.csproj'.
/home/okli/UnityProjects/SampleGame/Assembly-CSharp.csproj
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.Timeline.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.Animation.Runtime.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.PixelPerfect.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.VSCode.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.SpriteShape.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.TextMeshPro.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.Path.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'UnityEngine.UI.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.Timeline.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.Animation.Triangle.Runtime.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'PsdPlugin.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.CollabProxy.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.Rider.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.Mathematics.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.Psdimporter.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.InternalAPIEngineBridge.001.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.Sprite.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.Common.Runtime.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.Tilemap.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.SpriteShape.Runtime.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.PixelPerfect.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.Animation.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.Mathematics.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.TextMeshPro.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.Common.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.InternalAPIEditorBridge.001.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'UnityEditor.UI.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1193,5): Error: The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks

[fail]: OmniSharp.MSBuild.ProjectManager
    Attempted to update project that is not loaded: /home/okli/UnityProjects/SampleGame/Assembly-CSharp.csproj

Something seems does not work... However, I can modify and save my c# script (add a new public var by example, the variable is added in the unity interface), but the autocomplete code does not work, when I type public Rigidbod and press ctrl + space there isn't any autocomplete help displayed.

I am unfamiliar with C# / vscode / microsoft technologies, I prefer ask here If I forget something and/or did something wrong before try (bads) solutions

Thanks for some help !

EDIT : I just notified this error on the unity3D interface

enter image description here

I'll do some search about this error...

EDIT after 0xBFE1A8 answer :

the error doesn't disappears, so I continued :

After all of that, the autocomplete code in vsecode does not work but the error log is smaller :

Starting OmniSharp server at 4/5/2020, 6:56:52 PM
    Target: /home/okli/UnityProjects/plop/plop.sln

OmniSharp server started.
    Path: /home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/run
    PID: 30149

[info]: OmniSharp.Stdio.Host
    Starting OmniSharp on ubuntu 19.10 (x64)
[info]: OmniSharp.Services.DotNetCliService
    DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
    Located 1 MSBuild instance(s)
        1: StandAlone 16.4 - "/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
    MSBUILD_EXE_PATH environment variable set to '/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/MSBuild.dll'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
    Registered MSBuild instance: StandAlone 16.4 - "/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin"
        CscToolExe = csc.exe
        MSBuildToolsPath = /home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin
        CscToolPath = /home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Roslyn
        BypassFrameworkInstallChecks = true
        MSBuildExtensionsPath = /home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild
[info]: OmniSharp.Cake.CakeProjectSystem
    Detecting Cake files in '/home/okli/UnityProjects/plop'.
[info]: OmniSharp.Cake.CakeProjectSystem
    Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
    Detecting projects in '/home/okli/UnityProjects/plop/plop.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
    Queue project update for '/home/okli/UnityProjects/plop/Assembly-CSharp.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
    Detecting CSX files in '/home/okli/UnityProjects/plop'.
[info]: OmniSharp.Script.ScriptProjectSystem
    Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
[info]: OmniSharp.WorkspaceInitializer
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200
[info]: OmniSharp.WorkspaceInitializer
    Configuration finished.
[info]: OmniSharp.Stdio.Host
    Omnisharp server running using Stdio at location '/home/okli/UnityProjects/plop' on host 30017.
[info]: OmniSharp.MSBuild.ProjectManager
    Loading project: /home/okli/UnityProjects/plop/Assembly-CSharp.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
    The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
[warn]: OmniSharp.MSBuild.ProjectManager
    Failed to load project file '/home/okli/UnityProjects/plop/Assembly-CSharp.csproj'.
/home/okli/UnityProjects/plop/Assembly-CSharp.csproj
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1193,5): Error: The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks

[fail]: OmniSharp.MSBuild.ProjectManager
    Attempted to update project that is not loaded: /home/okli/UnityProjects/plop/Assembly-CSharp.csproj

Upvotes: 5

Views: 2463

Answers (4)

user1974
user1974

Reputation: 121

so I found a fix that works for me. The omnisharp website (https://github.com/OmniSharp/omnisharp-vscode) said something about, on linux, you need to set Use Global Mono for Omnisharp to 'never'. The default is 'auto'

Instead, I was able to fix this error by setting Use Global Mono to 'always', and it seems to be working. I no longer get errors, and intellisense is working.

Also, fwiw, I already have mono and dotnet installed.

Upvotes: 2

Gabriel Patriota
Gabriel Patriota

Reputation: 1

If the vscode unity auto complete are not working, install an older version of the c# extensio, by clicking in the configuration button

Upvotes: 0

Rafael Raposo
Rafael Raposo

Reputation: 128

I had the same problem, but had no relation to the MonoVersion. Downgrading to 1.1.3 and Generating the csproj files did the job. I found it odd because this error is related to the 1.1.4 version and started to investigate further for 1.2.1 of the vscode extension. The problem was in the sln file and I found a simple solution.

In UnityEditor go to: [Edit]->[Preferences]->[External Tools]: Click on checkbox to Generate .csproj files for: Embedded packages, then on Regenerate project files button to solve the autocompletion issue.

enter image description here

It added some lines to the sln file, and autocomplete now works without needing to downgrade the extension.

Hope it helps!

Upvotes: 1

Hamid Yusifli
Hamid Yusifli

Reputation: 10137

This warnings is a known Visual Studio Code Editor 1.1.4 bug. According to this information, it's Omnisharp extension that is causing the error:

This issue is caused by an extension, please file it with the repository (or contact) the extension has linked in its overview in VS Code or the marketplace for VS Code. See also our issue reporting guidelines.

Happy Coding!

For me, downgrading to version 1.1.3 of the package fixed the problems.

In UnityEditor go to: [Window]->[Package manager]->[Visual Studio Code Editor]->: Select 1.1.3 version and click to "Update 1.1.3" Button.

enter image description here

If the errors don't go away after that:

  • 1) Changed "com.unity.ide.vscode": "1.1.3" in "Packages/manifest.json"
  • 2) In UnityEditor go to: [Edit]->[Preferences]->[External Tools]: Set "Generate all .csproj files" CheckBox to true.
  • 3) In UnityEditor go to:[Assets]->[Reimport All]

Some people say that, if you downgrade to 1.1.3 and right after upgrade to 1.2.0 errors should be fixed, but I haven't tried it.

Upvotes: 5

Related Questions