dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.83k stars 654 forks source link

Omnisharp cannot evaluate item metadata #2069

Closed DarkZek closed 6 years ago

DarkZek commented 6 years ago

Environment data

dotnet --info output:

.NET Command Line Tools (2.1.4)

Product Information: Version: 2.1.4 Commit SHA-1 hash: 5e8add2190

Runtime Environment: OS Name: ubuntu OS Version: 17.10 OS Platform: Linux RID: linux-x64 Base Path: /usr/share/dotnet/sdk/2.1.4/

Microsoft .NET Core Shared Framework Host

Version : 2.0.5 Build : 17373eb129b3b05aa18ece963f8795d65ef8ea54

VS Code version: 1.20.1 C# Extension version: 1.14.0

Steps to reproduce

Create a new unity project. Try to use OmniSharp

Expected behavior

OmniSharp would not crash

Actual behavior

Omnisharp crashes Omnisharp log:

    Target: /home/darkzek/Documents/git/Wands/Magic Factorio/Magic Factorio.sln

OmniSharp server started wth Mono
    Path: /home/darkzek/.vscode/extensions/ms-vscode.csharp-1.14.0/.omnisharp/run
    PID: 6158

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on ubuntu 17.10 (x64)
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 1 MSBuild instance(s)
            1: StandAlone 15.0 - "/home/darkzek/.vscode/extensions/ms-vscode.csharp-1.14.0/.omnisharp/omnisharp/msbuild/15.0/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        MSBUILD_EXE_PATH environment variable set to '/home/darkzek/.vscode/extensions/ms-vscode.csharp-1.14.0/.omnisharp/omnisharp/msbuild/15.0/Bin/MSBuild.dll'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: StandAlone 15.0 - "/home/darkzek/.vscode/extensions/ms-vscode.csharp-1.14.0/.omnisharp/omnisharp/msbuild/15.0/Bin"
            MSBuildExtensionsPath = /home/darkzek/.vscode/extensions/ms-vscode.csharp-1.14.0/.omnisharp/omnisharp/msbuild
            CscToolPath = /home/darkzek/.vscode/extensions/ms-vscode.csharp-1.14.0/.omnisharp/omnisharp/msbuild/15.0/Bin/Roslyn
            CscToolExe = csc.exe
            MSBuildToolsPath = /home/darkzek/.vscode/extensions/ms-vscode.csharp-1.14.0/.omnisharp/omnisharp/msbuild/15.0/Bin
            TargetFrameworkRootPath = /usr/lib/mono/xbuild-frameworks
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in '/home/darkzek/Documents/git/Wands/Magic Factorio'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Initializing in /home/darkzek/Documents/git/Wands/Magic Factorio
[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.ProjectSystem
        Detecting projects in '/home/darkzek/Documents/git/Wands/Magic Factorio/Magic Factorio.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/home/darkzek/Documents/git/Wands/Magic Factorio/Assembly-CSharp.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/home/darkzek/Documents/git/Wands/Magic Factorio/Assembly-CSharp-Editor.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/home/darkzek/Documents/git/Wands/Magic Factorio'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.Stdio.Host
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.Stdio.Host
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location '/home/darkzek/Documents/git/Wands/Magic Factorio' on host 6063.
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /home/darkzek/Documents/git/Wands/Magic Factorio/Assembly-CSharp.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        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.ProjectManager
        Failed to load project file '/home/darkzek/Documents/git/Wands/Magic Factorio/Assembly-CSharp.csproj'.
/home/darkzek/Documents/git/Wands/Magic Factorio/Assembly-CSharp.csproj

I googled around, most posts said to update mono from a very old buggy version and one mentioned the Unity addon "VSCode" which hasn't helped.

DustinCampbell commented 6 years ago

Yes, you'll likely need to update your version of Mono. For Ubuntu, I recommend using the latest stable build here: http://www.mono-project.com/download/stable/#download-lin

DarkZek commented 6 years ago

Updating has fixed the issue. I just want to add incase anybody gets this same issue, the 16.04 mono repo will work with 17.10, which I assumed it wouldnt which is why I didnt try updating sooner.

DustinCampbell commented 6 years ago

Mono can be amazingly resilient on Linux. :smile: