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

'System' not found after update to dotnet core 3.0 #3290

Closed
trampster opened this issue Sep 24, 2019 · 79 comments
Closed

'System' not found after update to dotnet core 3.0 #3290

trampster opened this issue Sep 24, 2019 · 79 comments

Comments

@trampster
Copy link

trampster commented Sep 24, 2019

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
@erangeljr
Copy link

erangeljr commented Sep 24, 2019

I toggled the TargetFramework in client.csproj from netcoreapp3.0 => netcoreapp2.1 => netcoreapp3.0. I did restores, build, run for each transition.

I had clean install and didn't have netcore sdk 2.1 installed initially. Prior to this Omnisharp was failing, but failed to capture the log.

After netcore 2.1 install, that Omnisharp failed resolved, then I hit this issue.

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]
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.App 2.1.13 [/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 3.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

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

@ngollan
Copy link

ngollan commented Sep 24, 2019

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

@henriqueprj
Copy link

Same here

@ngollan
Copy link

ngollan commented Sep 24, 2019

Going back to rc1 makes IDE features work again.

@filipw
Copy link
Contributor

filipw commented Sep 24, 2019

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.

@steel97
Copy link

steel97 commented Sep 24, 2019

Same issue, I know that it can be fixed by installing visual studio 2019, but if you don't want install full VS2019, you can just install standalone build tools from VS2019, for me it resolved issue https://visualstudio.microsoft.com/downloads/?q=build+tools

@BrightSoul
Copy link

BrightSoul commented Sep 24, 2019

@filipw can you give us an ETA for the fix?
I'm also getting red squiggly lines everywhere.

red

@ignaciofuentes
Copy link

Same here on Mac. This was working just fine prior to installing .net core 3

@patrolez
Copy link

patrolez commented Sep 24, 2019

As a workaround, you can:

* Linux/MacOS [#3289 (comment)](https://github.com/OmniSharp/omnisharp-vscode/issues/3289#issuecomment-534396993)

ACK! Upgrading to Mono 6.4 solves problem under Linux!
(Under Mono 6.0 problem occurs as I have had this version before)

@apshoemaker
Copy link

apshoemaker commented Sep 24, 2019

I can confirm that upgrading Mono (I happen to be running 6.6 Preview) resolves this issue on my MacOS Mojave Macbook Pro.

@filipw
Copy link
Contributor

filipw commented Sep 24, 2019

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.

@cziedins
Copy link

Just tested "omnisharp.path": "1.34.4-beta.7" on Mac ... it doesn't seem to fix the issue here.
But thanks !

@chadly
Copy link

chadly commented Sep 24, 2019

I also just tried it and can confirm it did not work for me on Debian 10 with the default web template of netcore 3:

Starting OmniSharp server at 9/24/2019, 1:30:42 PM
    Target: /home/chad/dev/aspnet3

OmniSharp server started.
    Path: /home/chad/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.4-beta.7/run
    PID: 10492

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

This is the csproj generated by dotnet new web:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp3.0</TargetFramework>
  </PropertyGroup>

</Project>

@filipw
Copy link
Contributor

filipw commented Sep 24, 2019

ugh thanks. On *nix things are a bit complicated because we are shipping an embedded mono runtime, which is based on 5.18.1, looks like we may need to move to 6.0.0.

What is interesting is that when you have Mono installed, even if you don't use it in VS Code to run OmniSharp but still you run in Standalone mode (so no global Mono enabled in VS Code), because of how we pick up MSBuildExtensionsPath and TargetFrameworkRootPath from global Mono "behind the scenes", things work fine.

[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 1 MSBuild instance(s)
            1: StandAlone 16.0 - "/Users/filip/.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 '/Users/filip/.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 - "/Users/filip/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin"
            MSBuildExtensionsPath = /Library/Frameworks/Mono.framework/Versions/6.0.0/lib/mono/xbuild
            BypassFrameworkInstallChecks = true
            CscToolPath = /Users/filip/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Roslyn
            CscToolExe = csc.exe
            MSBuildToolsPath = /Users/filip/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin
            TargetFrameworkRootPath = /Library/Frameworks/Mono.framework/Versions/6.0.0/lib/mono/xbuild-frameworks

@waystilos
Copy link

waystilos commented Sep 24, 2019

This might be old news but I upgraded mono to the nightly build and everything started working. FYI, I'm getting "Not Found" page from the when trying to download the stable builds on mac mono-project.

@david-driscoll
Copy link
Contributor

@DustinCampbell would be able to give us some time to help solidify the process for building the embedded mono runtime, including things like getting it so that we can ship it to the Azure Storage account?

@RandomGHUser
Copy link

I recently had this issue when I had the 3.0 sdk and the 2.2.102 sdks installed. After uninstalling the 2.2.102 sdk, the issue went away. Perhaps this will help others.

@swainr
Copy link

swainr commented Sep 25, 2019

Using the beta of OmniSharp

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

mentioned here fixed this for me on Win10!

@mdx0111
Copy link

mdx0111 commented Sep 25, 2019

I got it fixed on my Fedora 30 by removing all the other SDKs and only having .Net Core 3 installed.

@trampster
Copy link
Author

Removing the other SDKS (2.1 and 2.2 in my case) got it working for me (Ubuntu 18.04)

I'm not sure if this affected the prereleases because microsoft have chosen not to provide prerelease packages for linux and thus do not get the benefit of my testing.

@squalsoft
Copy link

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.

@Peterwmoss
Copy link

Same issue here, using netcoreapp3.0 in TargetFramework gives errors all over.

@Britvich
Copy link

Like @squalsoft I installed Mono 6.4.0 from https://www.mono-project.com/download/stable/
(Visual Studio channel) and the problem disappeared on my macOS with multiple SDKs installed.

@kashifshaikh
Copy link

I upgraded my ancient Visual Studio for Mac to latest, and errors went away as well.

@leadanymind
Copy link

leadanymind commented Sep 27, 2019

I'm on Ubuntu 18.04, and I got it to work by removing older versions of my sdks/runtimes, and potentially needing to point to the beta version of omnisharp as mentioned above by editing the settings in vs code.

dotnet --list-sdks 3.0.100 [/usr/share/dotnet/sdk]
dotnet --list-runtimes Microsoft.AspNetCore.App 3.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
in my settings.json for vscode...

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

removed the old SDKs by following this documentation https://docs.microsoft.com/en-us/dotnet/core/versions/remove-runtime-sdk-versions?tabs=linux

@kahveci
Copy link

kahveci commented Sep 27, 2019

I can confirm that the beta build (1.34.4-beta.7) with fix works for Windows 10 Pro. Many thanks!

@snerks
Copy link

snerks commented Sep 27, 2019

@filipw - beta build (1.34.4-beta.7) works for Windows 10 Home. Excellent!

@marcogroppo
Copy link

@filipw ok, thanks!

@filipw
Copy link
Contributor

filipw commented Oct 3, 2019

Extension 1.21.4 with OmniSharp 1.34.4 and the fix above has been released - please update 😀
also, if you used a custom OmniSharp version via "omnisharp.path": .... setting I recommend you now remove it - as you'd be stuck on an old build.

@lonesomearchitect
Copy link

I am still getting the dreaded incorrect syntax highliting in VS code. I finally got it working at some point yesterday when I had Omnisharp configured to use the latest build, but then this morning all the errors came back.

I tried filipw's suggestion of now removing the line completely but that didn't work.

Here's the log from Omnisharp:

Starting OmniSharp server at 2019-10-04 09 h 39 min 33 s
Target: c:\Users\bracette\test-net-core-web-api\test-net-core-web-api.sln

OmniSharp server started.
Path: C:\Users\bracette.vscode\extensions\ms-vscode.csharp-1.21.3.omnisharp\1.34.3\OmniSharp.exe
PID: 6720

Starting OmniSharp on Windows 6.1.7601.65536 (x64)
info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 3 MSBuild instance(s)
1: Visual Studio Community 2019 16.2.29230.47 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin"
2: Visual Studio Enterprise 2017 15.9.28307.344 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin"
3: StandAlone 16.0 - "C:\Users\bracette.vscode\extensions\ms-vscode.csharp-1.21.3.omnisharp\1.34.3.msbuild\Current\Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: Visual Studio Community 2019 16.2.29230.47 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin"
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in 'c:\Users\bracette\test-net-core-web-api'.
info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
Detecting projects in 'c:\Users\bracette\test-net-core-web-api\test-net-core-web-api.sln'.
info: OmniSharp.MSBuild.ProjectManager
Queue project update for 'c:\Users\bracette\test-net-core-web-api\test-net-core-web-api.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'c:\Users\bracette\test-net-core-web-api'.
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: c:\Users\bracette\test-net-core-web-api\test-net-core-web-api.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 'c:\Users\bracette\test-net-core-web-api' on host 6336.
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file 'c:\Users\bracette\test-net-core-web-api\test-net-core-web-api.csproj'.
info: OmniSharp.MSBuild.ProjectManager
Adding project 'c:\Users\bracette\test-net-core-web-api\test-net-core-web-api.csproj'
info: OmniSharp.MSBuild.ProjectManager
Update project: test-net-core-web-api
[warn]: OmniSharp.MSBuild.PackageDependencyChecker
test-net-core-web-api: Did not find 'Microsoft.NETCore.App' in lock file.

@filipw
Copy link
Contributor

filipw commented Oct 4, 2019

  1. please update the extension to version 1.21.4 - according to your log you are using 1.21.3
  2. please update your VS 2019 to 16.3, this is needed to work with .NET Core 3.0. according to your log you are using Visual Studio Community 2019 16.2.29230.47. OmniSharp will use VS msbuild if found on the machine so you need at least 16.3 to be able to work with .NET Core 3.0

@vinothvkr
Copy link

Extension version 1.21.4 fixed the issue.

@lonesomearchitect
Copy link

Thank you guys for your quick answers, however, I can confirm that I am still getting the errors.

I am now using version 1.21.4 and not using my VS community, the errors are appearing in VS Code.

@lonesomearchitect
Copy link

Ok I got it working again. You guys were right. The MSBuild that was being used was the one from VS community even though I was running VS Code and my Community was outdated. Uninstalling Community did the trick.

Thanks!

@thinslice
Copy link

thinslice commented Oct 7, 2019

I have this problem even though I have C# extension version 1.21.4 and VSCode version 1.38.1.
Only the dotnet core 3.0 SDK and runtime are installed.
If I open a terminal at the project location and issue "dotnet run", the program compiles and runs without errors.
Should I open a separate issue?

There are spaces and accented characters in the project path. Could that be the problem?

OS: Lubuntu 18.04

About VSCode:
Version: 1.38.1
Commit: b37e54c98e1a74ba89e03073e5a3761284e3ffb0
Date: 2019-09-11T13:30:08.229Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Linux x64 4.15.0-58-generic snap

@filipw
Copy link
Contributor

filipw commented Oct 7, 2019

please post your Omnisharp log - thanks

@cichya
Copy link

cichya commented Oct 7, 2019

The same problem as @thinslice but on Ubuntu 18.04 with .net core 3.0 only installed

Version: 1.38.1
Commit: b37e54c98e1a74ba89e03073e5a3761284e3ffb0
Date: 2019-09-11T13:30:08.229Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Linux x64 4.15.0-65-generic

Omnisharp log from vs code

Starting OmniSharp server at 10/7/2019, 4:29:07 PM
    Target: /home/adi/Dev/test

OmniSharp server started.
    Path: /home/adi/.vscode/extensions/ms-vscode.csharp-1.21.4/.omnisharp/1.34.4/run
    PID: 10443

[info]: OmniSharp.Stdio.Host
        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/adi/.vscode/extensions/ms-vscode.csharp-1.21.4/.omnisharp/1.34.4/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        MSBUILD_EXE_PATH environment variable set to '/home/adi/.vscode/extensions/ms-vscode.csharp-1.21.4/.omnisharp/1.34.4/omnisharp/.msbuild/Current/Bin/MSBuild.dll'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: StandAlone 16.0 - "/home/adi/.vscode/extensions/ms-vscode.csharp-1.21.4/.omnisharp/1.34.4/omnisharp/.msbuild/Current/Bin"
            MSBuildExtensionsPath = /home/adi/.vscode/extensions/ms-vscode.csharp-1.21.4/.omnisharp/1.34.4/omnisharp/.msbuild
            BypassFrameworkInstallChecks = true
            CscToolPath = /home/adi/.vscode/extensions/ms-vscode.csharp-1.21.4/.omnisharp/1.34.4/omnisharp/.msbuild/Current/Bin/Roslyn
            CscToolExe = csc.exe
            MSBuildToolsPath = /home/adi/.vscode/extensions/ms-vscode.csharp-1.21.4/.omnisharp/1.34.4/omnisharp/.msbuild/Current/Bin
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in '/home/adi/Dev/test'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
        No solution files found in '/home/adi/Dev/test'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/home/adi/Dev/test/test.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/home/adi/Dev/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/adi/Dev/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/adi/Dev/test' on host 10273.
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file '/home/adi/Dev/test/test.csproj'.
/home/adi/Dev/test/test.csproj(1,1)
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk' specified could not be found.  /home/adi/Dev/test/test.csproj
  at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject (System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, System.Object[] args) [0x00040] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 
  at Microsoft.Build.Shared.ProjectErrorUtilities.VerifyThrowInvalidProject[T1] (System.Boolean condition, System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00003] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 
  at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject[T1] (Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].ExpandAndLoadImportsFromUnescapedImportExpressionConditioned (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement, System.Collections.Generic.List`1[Microsoft.Build.Construction.ProjectRootElement]& projects, Microsoft.Build.BackEnd.SdkResolution.SdkResult& sdkResult, System.Boolean throwOnFileNotExistsError) [0x00254] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].ExpandAndLoadImports (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement, Microsoft.Build.BackEnd.SdkResolution.SdkResult& sdkResult) [0x00027] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].EvaluateImportElement (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x0000d] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].PerformDepthFirstPass (Microsoft.Build.Construction.ProjectRootElement currentProjectOrImport) [0x000e6] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].Evaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Framework.BuildEventContext buildEventContext) [0x0011c] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].Evaluate (Microsoft.Build.Evaluation.IEvaluatorData`4[P,I,M,D] data, Microsoft.Build.Construction.ProjectRootElement root, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, System.Int32 maxNodeCount, Microsoft.Build.Collections.PropertyDictionary`1[T] environmentProperties, Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Evaluation.IItemFactory`2[S,T] itemFactory, Microsoft.Build.Evaluation.IToolsetProvider toolsetProvider, Microsoft.Build.Evaluation.ProjectRootElementCache projectRootElementCache, Microsoft.Build.Framework.BuildEventContext buildEventContext, Microsoft.Build.BackEnd.SdkResolution.ISdkResolverService sdkResolverService, System.Int32 submissionId, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext, System.Boolean interactive) [0x0002f] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 
  at Microsoft.Build.Evaluation.Project.Reevaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x0005e] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 
  at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00035] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 
  at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 
  at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00007] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 
  at Microsoft.Build.Evaluation.Project.Initialize (System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00126] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 
  at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00093] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 
  at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 
  at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 
  at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 
  at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion) [0x000f7] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 
  at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.String toolsVersion) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 
  at OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore (System.String filePath) [0x0003f] in <4d39b1cf1ca84cccbd4059b400c1cde5>:0 
  at OmniSharp.MSBuild.ProjectLoader.BuildProject (System.String filePath) [0x0000d] in <4d39b1cf1ca84cccbd4059b400c1cde5>:0 
  at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load (System.String filePath, OmniSharp.MSBuild.ProjectIdInfo projectIdInfo, OmniSharp.MSBuild.ProjectLoader loader) [0x00015] in <4d39b1cf1ca84cccbd4059b400c1cde5>:0 
  at OmniSharp.MSBuild.ProjectManager+<>c__DisplayClass29_0.<LoadProject>b__0 () [0x00000] in <4d39b1cf1ca84cccbd4059b400c1cde5>:0 
  at (wrapper delegate-invoke) System.Func`1[System.ValueTuple`3[OmniSharp.MSBuild.ProjectFile.ProjectFileInfo,System.Collections.Immutable.ImmutableArray`1[OmniSharp.MSBuild.Logging.MSBuildDiagnostic],OmniSharp.MSBuild.Notification.ProjectLoadedEventArgs]].invoke_TResult()
  at OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject (System.String projectFilePath, System.Func`1[TResult] loader) [0x0001b] in <4d39b1cf1ca84cccbd4059b400c1cde5>:0 

[fail]: OmniSharp.MSBuild.ProjectManager
        Attempted to update project that is not loaded: /home/adi/Dev/test/test.csproj

With omnisharp.json file in open folder the .vscode is created and project run properly

{
    "MsBuild": {
        "UseLegacySdkResolver": true
    }
}

@filipw
Copy link
Contributor

filipw commented Oct 7, 2019

how did you install dotnet core SDK, was it snap installed?

@cichya
Copy link

cichya commented Oct 7, 2019

Installed by install scripts:

https://dotnet.microsoft.com/download/linux-package-manager/ubuntu18-04/sdk-3.0.100

Snap has been installed because I didin't have 'dotnet' command after installation.

@davidcv5
Copy link

davidcv5 commented Oct 18, 2019

@filipw I still have this issue with VSCode 1.39.2, Mono 6.4.0 and OmniSharp 1.34.5, please help.
I don't have any errors in OmniSharp, only warnings, but still everything fails.

dotnet

dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.0.100
 Commit:    04339c3a26

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.14
 OS Platform: Darwin
 RID:         osx.10.14-x64
 Base Path:   /usr/local/share/dotnet/sdk/3.0.100/

Host (useful for support):
  Version: 3.0.0
  Commit:  7d57652f33

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

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.2.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.2.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.2.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

OmniSharp Logs

Starting OmniSharp server at 10/18/2019, 11:40:54 AM
    Target: /Users/me/projects/kaplan/MyApp/MyApp.sln

OmniSharp server started with Mono 6.4.0.
    Path: /Users/me/.vscode/extensions/ms-vscode.csharp-1.21.5/.omnisharp/1.34.5/omnisharp/OmniSharp.exe
    PID: 66024

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on MacOS 10.14.6 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 2 MSBuild instance(s)
            1: Mono 16.0 - "/usr/local/Cellar/mono/6.4.0.198/lib/mono/msbuild/Current/bin"
            2: StandAlone 16.0 - "/Users/me/.vscode/extensions/ms-vscode.csharp-1.21.5/.omnisharp/1.34.5/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Mono 16.0 - "/usr/local/Cellar/mono/6.4.0.198/lib/mono/msbuild/Current/bin"
            CscToolExe = csc.exe
            CscToolPath = /Users/me/.vscode/extensions/ms-vscode.csharp-1.21.5/.omnisharp/1.34.5/omnisharp/.msbuild/Current/Bin/Roslyn

...

[warn]: OmniSharp.MSBuild.PackageDependencyChecker
        Project1: Did not find 'NETStandard.Library' in lock file.
[warn]: OmniSharp.MSBuild.PackageDependencyChecker
        Project2: Did not find 'Microsoft.NETCore.App' in lock file.
[warn]: OmniSharp.MSBuild.PackageDependencyChecker
        Project3: Found implicit package reference 'NETStandard.Library', but none of the versions in the lock file ("1.6.1") satisfy [2.0.2, )
[warn]: OmniSharp.MSBuild.PackageDependencyChecker
        Project4: Found implicit package reference 'NETStandard.Library', but none of the versions in the lock file ("1.6.1") satisfy [2.0.2, )
[warn]: OmniSharp.MSBuild.PackageDependencyChecker
        Project1.Test: Did not find 'Microsoft.NETCore.App' in lock file.
[warn]: OmniSharp.MSBuild.PackageDependencyChecker
        Project2.Test: Did not find 'Microsoft.NETCore.App' in lock file.
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.CachingCodeFixProviderForProjects
        Skipping code fix provider 'Microsoft.CodeAnalysis.Analyzers.MetaAnalyzers.CodeFixes.ApplyDiagnosticAnalyzerAttributeFix' because its language doesn't match 'C#'.

@keeed
Copy link

keeed commented Oct 21, 2019

In my case, I have an outdated Visual Studio 2019. I saw in the logs that Omnisharp is using the one inside the Visual Studio 2019 installation. I updated VS 2019 to the latest version ( the one that supports .NET Core 3.0) and the error in VScode was gone after :)

@koliyo
Copy link

koliyo commented Oct 21, 2019

Same problem here on MacOS. I have mono 6.4.0 installed via Homebrew. Using beta omnisharp version "omnisharp.path": "latest" does not help

OmniSharp server started with Mono 6.4.0.
    Path: /Users/nils/.vscode/extensions/ms-vscode.csharp-1.21.5/.omnisharp/1.34.6-beta.34/omnisharp/OmniSharp.exe
The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [omnisharp-debug]

Using the default project created using

dotnet new console

@koliyo
Copy link

koliyo commented Oct 21, 2019

I found a solution here: #2147 (comment)

I have Visual Studio 2019 (installed by Unity), and checking for updates downloaded new versions of runtime/libs. After this the omnisharp problems in VS Code was resolved!

Ugh, took a lot of effort to trace this though!

Ping @davidcv5, do you have Visual Studio 2019 as well?

So to summarize, my environment:

  • MacOS
  • Mono (Homebrew)
  • Visual Studio 2019 (Unity)
  • .Net Core 3.0 (Homebrew)

@davidcv5
Copy link

davidcv5 commented Oct 21, 2019

@koliyo I'm using vscode, nothing has worked for me so far, so had to change to full visual studio for mac in the meantime, but don't like it as much as vscode. Visual Studio 2019 for Mac 8.4 Preview works just fine.

@dan655t
Copy link

dan655t commented Oct 24, 2019

+1 also having this problem on mac.

dotnet --info

.NET Core SDK (reflecting any global.json):
 Version:   3.0.100
 Commit:    04339c3a26

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.14
 OS Platform: Darwin
 RID:         osx.10.14-x64
 Base Path:   /usr/local/share/dotnet/sdk/3.0.100/

Host (useful for support):
  Version: 3.0.0
  Commit:  7d57652f33

.NET Core SDKs installed:
  2.1.402 [/usr/local/share/dotnet/sdk]
  2.2.101 [/usr/local/share/dotnet/sdk]
  3.0.100 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

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

Omnisharp log

Starting OmniSharp server at 10/24/2019, 12:50:25 PM
    Target: /Users/dgraham/git/dan655t/mvc-test

OmniSharp server started with Mono 6.4.0.
    Path: /Users/dgraham/.vscode/extensions/ms-vscode.csharp-1.21.5/.omnisharp/1.34.5/omnisharp/OmniSharp.exe
    PID: 66552

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on MacOS 10.14.6 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 2 MSBuild instance(s)
            1: Mono 16.0 - "/usr/local/Cellar/mono/6.4.0.198/lib/mono/msbuild/Current/bin"
            2: StandAlone 16.0 - "/Users/dgraham/.vscode/extensions/ms-vscode.csharp-1.21.5/.omnisharp/1.34.5/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Mono 16.0 - "/usr/local/Cellar/mono/6.4.0.198/lib/mono/msbuild/Current/bin"
            CscToolExe = csc.exe
            CscToolPath = /Users/dgraham/.vscode/extensions/ms-vscode.csharp-1.21.5/.omnisharp/1.34.5/omnisharp/.msbuild/Current/Bin/Roslyn
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in '/Users/dgraham/git/dan655t/mvc-test'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
        No solution files found in '/Users/dgraham/git/dan655t/mvc-test'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/dgraham/git/dan655t/mvc-test/mvc-test.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/Users/dgraham/git/dan655t/mvc-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.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/dgraham/git/dan655t/mvc-test/mvc-test.csproj
[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 '/Users/dgraham/git/dan655t/mvc-test' on host 66515.
[info]: OmniSharp.OmniSharpWorkspace
        Miscellaneous file: /Users/dgraham/git/dan655t/mvc-test/Views/Shared/_Layout.cshtml__virtual.cs added to workspace
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/dgraham/git/dan655t/mvc-test/mvc-test.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/dgraham/git/dan655t/mvc-test/mvc-test.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: mvc-test
[warn]: OmniSharp.MSBuild.PackageDependencyChecker
        mvc-test: Did not find 'Microsoft.NETCore.App' in lock file.
[info]: OmniSharp.Roslyn.CSharp.Services.Diagnostics.CSharpDiagnosticWorkerWithAnalyzers
        Solution initialized -> queue all documents for code analysis. Initial document count: 7.

@dan655t
Copy link

dan655t commented Oct 28, 2019

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.

@smitssjors
Copy link

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.

@paladin2005
Copy link

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.

That's work!

@DavidPalTech
Copy link

This issue basically saved my day. Today I decided to learn how to make c# web apps with .net.
I had this issue and tried every solution that appeared in internet. 8 hours later , i found this issue , write "omnisharp.path": "1.34.4-beta.7" in my settings.json , and at the third or second attempt it worked ! . Now i can code without any error. Thank you !

@buster95
Copy link

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.

thank you @filipw, I just update msbuild on visual studio 2019

@bradymholt
Copy link

bradymholt commented Jun 9, 2020

I had this problem on macOS and had Mono 6.8.0.96 installed via Homebrew. When I installed Mono 6.8.0 (Visual Studio channel) from the Mono website it finally started working.

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