OmniSharp stops working after Mono is installed.
See original GitHub issueEnvironment data
.NET Command Line Tools (2.1.3)
Product Information:
Version: 2.1.3
Commit SHA-1 hash: a0ca411ca5
Runtime Environment:
OS Name: gentoo
OS Version:
OS Platform: Linux
RID: linux-x64
Base Path: /opt/dotnet_core/sdk/2.1.3/
Microsoft .NET Core Shared Framework Host
Version : 2.0.4
Build : 7f262f453d8c8479b9af91d34c013b3aa05bc1ff
VS Code version: 1.20.0-1516947444 C# Extension version: 1.13.1
Steps to reproduce
Install the .NET Core SDK without Mono and a fresh install of VSCode. Open up a C# project and verify that extension functionality works.
Install Mono alongside the dotnet tool. Try opening the same project in VSCode.
Install MSBuild for Mono since the OmniSharp warning suggests to do so. Try opening the same project in VSCode.
Expected behavior
Intellisense, CodeLens, etc. works in all three scenarios. After installing MSBuild, the warning that it is not installed goes away.
Actual behavior
Intellisense, CodeLens, etc. only work in the case where .NET Core is installed without Mono or Mono MSBuild. The warning that MSBuild is not installed remains after it is installed alongside Mono.
Starting OmniSharp server at 2/2/2018, 12:25:16 AM
Target: /home/jaccarmac/src/src/jaccarmac.com/junkcode/free-monad-vs-typeclass
OmniSharp server started wth Mono
Path: /home/jaccarmac/.vscode-insiders/extensions/ms-vscode.csharp-1.13.1/.omnisharp/omnisharp/OmniSharp.exe
PID: 20413
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on gentoo 0.0 (x64)
[warn]: OmniSharp.MSBuild.Discovery.Providers.MonoInstanceProvider
It looks like you have Mono 5.2.0 or greater installed but MSBuild could not be found.
Try installing MSBuild into Mono (e.g. 'sudo apt-get install msbuild') to enable better MSBuild support.
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 15.0 - "/home/jaccarmac/.vscode-insiders/extensions/ms-vscode.csharp-1.13.1/.omnisharp/omnisharp/msbuild/15.0/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/home/jaccarmac/.vscode-insiders/extensions/ms-vscode.csharp-1.13.1/.omnisharp/omnisharp/msbuild/15.0/Bin/MSBuild.dll'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 15.0 - "/home/jaccarmac/.vscode-insiders/extensions/ms-vscode.csharp-1.13.1/.omnisharp/omnisharp/msbuild/15.0/Bin"
MSBuildExtensionsPath = /usr/lib/mono/xbuild
CscToolPath = /home/jaccarmac/.vscode-insiders/extensions/ms-vscode.csharp-1.13.1/.omnisharp/omnisharp/msbuild/15.0/Bin/Roslyn
CscToolExe = csc.exe
MSBuildToolsPath = /home/jaccarmac/.vscode-insiders/extensions/ms-vscode.csharp-1.13.1/.omnisharp/omnisharp/msbuild/15.0/Bin
TargetFrameworkRootPath = /usr/lib/mono/xbuild-frameworks
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/home/jaccarmac/src/src/jaccarmac.com/junkcode/free-monad-vs-typeclass'.
[info]: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
[info]: OmniSharp.DotNet.DotNetProjectSystem
Initializing in /home/jaccarmac/src/src/jaccarmac.com/junkcode/free-monad-vs-typeclass
[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.MSBuildProjectSystem
No solution files found in '/home/jaccarmac/src/src/jaccarmac.com/junkcode/free-monad-vs-typeclass'
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Loading project: /home/jaccarmac/src/src/jaccarmac.com/junkcode/free-monad-vs-typeclass/free-monad-vs-typeclass.csproj
[warn]: OmniSharp.MSBuild.MSBuildProjectSystem
Failed to load project file '/home/jaccarmac/src/src/jaccarmac.com/junkcode/free-monad-vs-typeclass/free-monad-vs-typeclass.csproj'.
/home/jaccarmac/src/src/jaccarmac.com/junkcode/free-monad-vs-typeclass/free-monad-vs-typeclass.csproj(1,1)
Microsoft.Build.Exceptions.InvalidProjectFileException: The imported project "/usr/lib/mono/xbuild/15.0/Microsoft.Common.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. /opt/dotnet_core/sdk/2.1.3/Sdks/Microsoft.NET.Sdk/Sdk/Sdk.props
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject (System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, System.Object[] args) [0x00042] in <9ba305957e954df9b0ed46d97ba8f5be>: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 <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject[T1] (Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00000] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].ExpandAndLoadImportsFromUnescapedImportExpression (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement, System.String unescapedExpression, System.Boolean throwOnFileNotExistsError, System.Collections.Generic.List`1[Microsoft.Build.Construction.ProjectRootElement]& imports) [0x00517] in <9ba305957e954df9b0ed46d97ba8f5be>: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, System.Boolean throwOnFileNotExistsError) [0x001a6] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].ExpandAndLoadImports (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x00024] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].EvaluateImportElement (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x00000] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].PerformDepthFirstPass (Microsoft.Build.Construction.ProjectRootElement currentProjectOrImport) [0x001dd] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].EvaluateImportElement (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x0002d] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].PerformDepthFirstPass (Microsoft.Build.Construction.ProjectRootElement currentProjectOrImport) [0x000c8] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].Evaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Framework.BuildEventContext buildEventContext) [0x000df] in <9ba305957e954df9b0ed46d97ba8f5be>: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.Execution.ProjectInstance projectInstanceIfAnyForDebuggerOnly, Microsoft.Build.BackEnd.SdkResolution sdkResolution) [0x00016] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Project.Reevaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x0004c] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00034] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation) [0x00000] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary () [0x00007] in <9ba305957e954df9b0ed46d97ba8f5be>: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) [0x000e9] in <9ba305957e954df9b0ed46d97ba8f5be>: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) [0x0009c] in <9ba305957e954df9b0ed46d97ba8f5be>: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 <9ba305957e954df9b0ed46d97ba8f5be>: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 <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion) [0x000f5] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.String toolsVersion) [0x00000] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.LoadProject (System.String filePath, System.String solutionDirectory, Microsoft.Extensions.Logging.ILogger logger, OmniSharp.MSBuild.Discovery.MSBuildInstance msbuildInstance, OmniSharp.MSBuild.SdksPathResolver sdksPathResolver, OmniSharp.Options.MSBuildOptions options, System.Collections.Generic.ICollection`1[T] diagnostics, System.Collections.Immutable.ImmutableArray`1[System.String]& targetFrameworks) [0x00054] in <e904597b17e840d49e5c532b51773be0>:0
at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Create (System.String filePath, System.String solutionDirectory, Microsoft.Extensions.Logging.ILogger logger, OmniSharp.MSBuild.Discovery.MSBuildInstance msbuildInstance, OmniSharp.MSBuild.SdksPathResolver sdksPathResolver, OmniSharp.Options.MSBuildOptions options, System.Collections.Generic.ICollection`1[T] diagnostics) [0x0000a] in <e904597b17e840d49e5c532b51773be0>:0
at OmniSharp.MSBuild.MSBuildProjectSystem.LoadProject (System.String projectFilePath) [0x00038] in <e904597b17e840d49e5c532b51773be0>:0
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/home/jaccarmac/src/src/jaccarmac.com/junkcode/free-monad-vs-typeclass'.
[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/jaccarmac/src/src/jaccarmac.com/junkcode/free-monad-vs-typeclass' on host 18205.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:11
- Comments:55 (14 by maintainers)
Top Results From Across the Web
Omnisharp not working with Mono and Unity on Gentoo
My OS is Gentoo, x64. I am currently trying to make VSCode work properly with Unity. I have 2 Mono installations: one is...
Read more >VSCode omnisharp not loading - Unity Answers
The most common solution is to make sure Mono is fully updated on your machine (https://mono-project.com/download/) and that you are running the ...
Read more >Omnisharp not loading properly - Visual Studio Code and Unity
The most common solution is to make sure Mono is fully updated on your machine (https://mono-project.com/download/) and that you are running the ...
Read more >The Real Ultimate Guide to Fixing OmniSharp in VS Code | Blog
There are times when OmniSharp does not start up at all, in which case you can run a command to restart it. In...
Read more >VSCode OmniSharp on Ubuntu fails to locate Mono
ProjectManager Attempted to update project that is not loaded: ... since omnisharp is running and looking for global mono (which is ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m on arch solved this issue by uninstall “msbuild-bin” and install “msbuild-stable” (15.4_xamarinxplat.2017.11.27.11.23_0xamarin1_ubuntu1404b1-3) instead.
Could you try setting “omnisharp.useGlobalMono”: never and then restarting the omnisharp server.