Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Omnisharp in VS Code produces a lot of warnings about a Unity project. Why?

Omnisharp in VS Code produces a lot of warnings about a Unity project. Why?

When I open a script in VS Code from a Unity Editor here is what I see:

enter image description here

The Omnisharp produces warning. Here are a few of them:

[warn]: OmniSharp.MSBuild.ProjectLoader
        The referenced project 'Unity.Timeline.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.TextMeshPro.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
...
[warn]: OmniSharp.MSBuild.ProjectManager
        Expected project reference c:\Projects\Unity\Combo Bombo\Unity.2D.Sprite.Editor.csproj to be already loaded for project Assembly-CSharp
[warn]: OmniSharp.MSBuild.ProjectManager
        Expected project reference c:\Projects\Unity\Combo Bombo\Unity.2D.Tilemap.Editor.csproj to be already loaded for project Assembly-CSharp
[warn]: OmniSharp.MSBuild.ProjectManager
        Expected project reference c:\Projects\Unity\Combo Bombo\Unity.TextMeshPro.csproj to be already loaded for project Assembly-CSharp
[warn]: OmniSharp.MSBuild.ProjectManager
        Expected project reference c:\Projects\Unity\Combo Bombo\UnityEditor.UI.csproj to be already loaded for project Assembly-CSharp

Does anyone know why the warnings happen and how could I fix them?

I am not sure what else should I provide for a successful diagnose of the issue. So, could you, please, ask in comments in case I have to tell something else about the issue for a successful diagnose.

I have the 1.42.1 VS Code version:

enter image description here

like image 571
qqqqqqq Avatar asked Feb 22 '20 18:02

qqqqqqq


People also ask

What is OmniSharp in Vscode?

OmniSharp is a set of tooling, editor integrations and libraries that together create an ecosystem that allows you to have a great programming experience no matter what your editor and operating system of choice may be.

Does Visual Studio use OmniSharp?

C# for Visual Studio Code (powered by OmniSharp) This extension provides the following features inside VS Code: Lightweight development tools for . NET Core.

Does OmniSharp need mono?

OmniSharp requires a complete install of Mono (including MSBuild) to provide language services when omnisharp. useModernNet is disabled in Settings. Please install the latest Mono and restart.


2 Answers

This issue has also been solved in 1.2.0. Just update your vs code package to this version via the package manager. Then regenerate your project files by navigating to Edit -> Preferences -> Regenerate Project Files. Reopening a .cs file should then solve your problem.

like image 75
grim in the dark Avatar answered Sep 20 '22 15:09

grim in the dark


This warnings is a known Visual Studio Code Editor 1.1.4 bug, you can ignore it. For me, downgrading to version 1.1.3 of the package fixed the problems.

enter image description here

like image 29
Hamid Yusifli Avatar answered Sep 20 '22 15:09

Hamid Yusifli