Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omnisharp breaks after last update #4013

Closed
nxfs opened this issue Aug 21, 2020 · 2 comments
Closed

Omnisharp breaks after last update #4013

nxfs opened this issue Aug 21, 2020 · 2 comments

Comments

@nxfs
Copy link

nxfs commented Aug 21, 2020

Issue Description

After updating the Omnisharp to v1.37, it fails to start.
The first problem is that this error appears:

[fail]: OmniSharp.MSBuild.ProjectLoader
        The reference assemblies for .NETFramework,Version=v4.7 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

I figured that by overriding the framework it goes away:

export FrameworkPathOverride=/usr/lib/mono/4.7-api
code

However in this configuration Omnisharp fails to recognize classes defined in nuget pacakges

I realize I can reproduce the problem outside of VSCode:

dotnet msbuild  project.csproj

scenes/city/tgf/SplineTransform.cs(1,7): error CS0246: The type or namespace name 'Extreme' could not be found (are you missing a using directive or an assembly reference?)
...

However if I build with the mono msbuild it works fine.
The difference is as follows:

msbuild -version
Microsoft (R) Build Engine version 16.6.0 for Mono
Copyright (C) Microsoft Corporation. All rights reserved.

16.6.0.32601%

dotnet msbuild -version
Microsoft (R) Build Engine version 16.7.0-preview-20360-03+188921e2f for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

16.7.0.36003% 

Using restore has no effect.

Steps to Reproduce

See description above. I am not sure if I can attempt to create a minimal project to reproduce.

Expected Behavior

Resolving classes defined Nuget packages

Actual Behavior

Not resolved

Logs

OmniSharp log

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on ubuntu 16.4 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 1 MSBuild instance(s)
            1: StandAlone 16.8.0 - "/some-path/.vscode/extensions/ms-dotnettools.csharp-1.23.1/.omnisharp/1.37.0/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        MSBUILD_EXE_PATH environment variable set to '/some-path/.vscode/extensions/ms-dotnettools.csharp-1.23.1/.omnisharp/1.37.0/omnisharp/.msbuild/Current/Bin/MSBuild.exe'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: StandAlone 16.8.0 - "/some-path/.vscode/extensions/ms-dotnettools.csharp-1.23.1/.omnisharp/1.37.0/omnisharp/.msbuild/Current/Bin"
            CscToolExe = csc.exe
            MSBuildToolsPath = /some-path/.vscode/extensions/ms-dotnettools.csharp-1.23.1/.omnisharp/1.37.0/omnisharp/.msbuild/Current/Bin
            CscToolPath = /some-path/.vscode/extensions/ms-dotnettools.csharp-1.23.1/.omnisharp/1.37.0/omnisharp/.msbuild/Current/Bin/Roslyn
            BypassFrameworkInstallChecks = true
            MSBuildExtensionsPath = /some-path/.vscode/extensions/ms-dotnettools.csharp-1.23.1/.omnisharp/1.37.0/omnisharp/.msbuild
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in '/some-path/private/some-project'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
        Detecting projects in '/some-path/private/some-project/some-project.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/some-path/private/some-project/some-project.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/some-path/private/some-project'.
[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.MSBuild.ProjectManager
        Loading project: /some-path/private/some-project/some-project.csproj
[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.BlockStructureWorkspaceOptionsProvider, Order: 140
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location '/some-path/private/some-project' on host 23164.
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/some-path/private/some-project/some-project.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/some-path/private/some-project/some-project.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: some-project

C# log

n/a

Environment information

VSCode version: 1.48.0
C# Extension: 1.23.1

Mono Information OmniSharp using built-in mono
Dotnet Information .NET Core SDK (reflecting any global.json): Version: 3.1.401 Commit: 39d17847db

Runtime Environment:
OS Name: ubuntu
OS Version: 16.04
OS Platform: Linux
RID: ubuntu.16.04-x64
Base Path: /usr/share/dotnet/sdk/3.1.401/

Host (useful for support):
Version: 3.1.7
Commit: fcfdef8d6b

.NET Core SDKs installed:
2.2.402 [/usr/share/dotnet/sdk]
3.1.401 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.8 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.8 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.7 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.8 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.7 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download

Visual Studio Code Extensions
Extension Author Version
cpptools ms-vscode 0.29.0
csharp ms-dotnettools 1.23.1
godot-tools geequlim 1.1.1
mono-debug ms-vscode 0.15.8
unity-debug Unity 2.7.5
unity-tools Tobiah 1.2.3
vscode-nuget-package-manager jmrog 1.1.6
vscode-nxunit-test-adapter wghats 0.1.3
vscode-test-explorer hbenl 2.19.1
@nxfs
Copy link
Author

nxfs commented Aug 21, 2020

Now that I read the release notice, I realize this is probably due to

Note about using .NET Core 3.1.401 or .NET 5 Preview 8 SDKs on Mono platforms

Because of the new minimum MSBuild version requirement of these new SDKs, it will be necessary to use the Mono packaged with the C# extension. You can set "omnisharp.useGlobalMono" to "never" in the VS Code settings to force the use of the included Mono.

I reverted the extension to 1.22 and it works. Is there any way I can keep using the latest version? Thanks for the help

@filipw
Copy link
Contributor

filipw commented Aug 22, 2020

thanks for the issue I will close it as a duplicate
see #4007 (comment) for a workaround

@filipw filipw closed this as completed Aug 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants