Solvedomnisharp vscode 'System' not found after update to dotnet core 3.0

Issue Description

Steps to Reproduce

  • Updated to dotnet core 3.0 following instructions here
  • Created new project with dotnet new console
  • Run dotnet build (0 errors and 0 warnings)
  • Opened Program.cs

Expected Behavior

  • No red swiggly lines, with error messages about everything

Actual Behavior

  • Everything of significant's is underlined with errors on hover about System or a sub namespace being missing.

omnisharp

Logs

OmniSharp log

Starting OmniSharp server at 24/09/2019, 11:08:29 PM Target: /home/daniel/Work/test

OmniSharp server started.
Path: /home/daniel/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/run
PID: 6357

Starting OmniSharp on ubuntu 18.4 (x64)
info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 16.0 - "/home/daniel/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/home/daniel/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/MSBuild.dll'
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.0 - "/home/daniel/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin"
MSBuildExtensionsPath = /home/daniel/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild
BypassFrameworkInstallChecks = true
CscToolPath = /home/daniel/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Roslyn
CscToolExe = csc.exe
MSBuildToolsPath = /home/daniel/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin
TargetFrameworkRootPath = /usr/lib/mono/xbuild-frameworks
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/home/daniel/Work/test'.
info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
No solution files found in '/home/daniel/Work/test'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/daniel/Work/test/test.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/home/daniel/Work/test'.
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: /home/daniel/Work/test/test.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.EditorConfigWorkspaceOptionsProvider, Order: 200
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/home/daniel/Work/test' on host 6235.
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/home/daniel/Work/test/test.csproj'.
info: OmniSharp.MSBuild.ProjectManager
Adding project '/home/daniel/Work/test/test.csproj'
info: OmniSharp.MSBuild.ProjectManager
Update project: test
[warn]: OmniSharp.MSBuild.PackageDependencyChecker
test: Did not find 'Microsoft.NETCore.App' in lock file.

C# log

NA

Environment information

VSCode version: 1.38.1
C# Extension: 1.21.3

Mono Information OmniSharp using built-in mono
Dotnet Information .NET Core SDK (reflecting any global.json): Version: 3.0.100 Commit: 04339c3a26

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

Host (useful for support):
Version: 3.0.0
Commit: 95a0a61858

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

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.13 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.7 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.13 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.7 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.7 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0 [/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
csharp ms-vscode 1.21.3
docomment k--kato 0.1.8
dotnet-test-explorer formulahendry 0.7.1
ShowTestResults EffectiveLabs 0.4.0
52 Answers

✔️Accepted Answer

I was able to resolve this issue by uninstalling mono via brew and letting omnisharp use the MSBuild that it ships with.

As a note for the omnisharp team I was on the latest version of mono via brew.

Setting "omnisharp.useGlobalMono": "never" achieves the same (I think) and fixed it for me.

Other Answers:

This is the same problem as described in #3289

As a workaround, you can:

edit:
For Windows there is also a new OmniSharp build with a fix.

To try it, add the following to your VS Code settings and restart VS Code:

    "omnisharp.path": "1.34.4-beta.7"

This will download the latest prerelease OmniSharp to your VS Code and hopefully help. Thanks.

if you have this problem and haven't used any of the workarounds mentioned here #3290 (comment) we currently have a new OmniSharp build to test out, which hopefully fixes the issue. I only tested on Windows, but it seems to have fixed it there.

To try it, add the following to your VS Code settings and restart VS Code:

    "omnisharp.path": "1.34.4-beta.7"

This will download the latest prerelease OmniSharp to your VS Code and hopefully help. Thanks.

I installed Mono 6.4.0 from here https://www.mono-project.com/download/stable/
And problem (Did not find 'Microsoft.NETCore.App' in lock file.) disappeared on my MacOs with multiple SDKs.

I have the same problem, and it worked just fine with the previews and intermediate VS release.

More Issues: