Omnisharp doesn't work, VSCode output doesn't even include Omnisharp in the dropdown list
Environment data
dotnet --info output:
Product Information:
Version: 2.0.2
Commit SHA-1 hash: a04b4bf512
Runtime Environment: OS Name: Mac OS X OS Version: 10.13 OS Platform: Darwin RID: osx.10.12-x64 VS Code version: 1.18 C# Extension version: 1.13.1
Steps to reproduce
After automatically getting the latest VSCode (1.18 with blue icon now) and re-installing the C# extension, Omnisharp doesn't work.
Tried:
- opening many different projects
- Removing and installing the extension
- removing and installing VSCODE
- Installing Mono and dotnet again and again :)
- Installing Omnisharp with Brew
What I really would like is to have some hints on how to debug why it doesn't work on my system. I assume this is a user issue, but I already spend 3 hours trying to debug without any success. I tried also to enable: "omnisharp.loggingLevel": "debug" - but since the output doesn't include Omnisharp it doesn't really help...
Any help?
Thanks!
Expected behavior
Actual behavior
Same for me. It was working on 1.17 a couple hours ago then VSCode automatically updated to 1.18 and restarted and now Omnisharp doesn't work anymore. Nothing else changed. For me it's printing this to the console:
Failed to spawn 'dotnet --info'
Tried the same steps to fixing it as @shalevy2888
Could you check your ~/.vscode/extensions folder (%UserProfile%\.vscode\extensions on Windows) and ensure there's just a single ms-vscode.csharp-* extension installed?
Only one extension installed, here is the ls: lshay-mac03:~ lshay$ cd ~/.vscode/extensions lshay-mac03:extensions lshay$ ls -laF total 32 drwxr-xr-x 20 lshay staff 640 Nov 14 12:31 ./ drwxr-xr-x 4 lshay staff 128 Nov 14 11:22 ../ -rw-r--r--@ 1 lshay staff 12292 Nov 14 12:31 .DS_Store drwxr-xr-x 18 lshay staff 576 Nov 13 11:39 PKief.material-icon-theme-3.0.0/ drwxr-xr-x 14 lshay staff 448 Nov 5 14:27 Shan.code-settings-sync-2.8.5/ drwxr-xr-x 11 lshay staff 352 Sep 19 22:23 Tobiah.unity-tools-0.1.9/ drwxr-xr-x 9 lshay staff 288 Sep 26 11:21 Unity.unity-debug-1.2.1/ drwxr-xr-x 9 lshay staff 288 Sep 19 22:23 casualjim.theme-desertex-0.0.6/ drwxr-xr-x 13 lshay staff 416 Oct 2 13:48 eppz.eppz-code-1.2.41/ drwxr-xr-x 8 lshay staff 256 Sep 19 22:23 lionize.unity-snippets-modified-0.3.2/ drwxr-xr-x 20 lshay staff 640 Oct 3 13:20 magicstack.magicpython-1.0.12/ drwxr-xr-x 27 lshay staff 864 Nov 13 11:39 ms-python.python-0.8.0/ drwxr-xr-x 20 lshay staff 640 Nov 14 12:32 ms-vscode.csharp-1.13.1/ drwxr-xr-x 13 lshay staff 416 Nov 13 11:39 ms-vscode.mono-debug-0.15.8/ drwxr-xr-x 21 lshay staff 672 Oct 30 19:37 robertohuertasm.vscode-icons-7.17.0/ drwxr-xr-x 16 lshay staff 512 Oct 30 19:37 streetsidesoftware.code-spell-checker-1.4.12/ drwxr-xr-x 19 lshay staff 608 Oct 3 13:20 tht13.python-0.2.3/ drwxr-xr-x 9 lshay staff 288 Sep 19 22:23 wayou.vscode-todo-highlight-0.5.11/ drwxr-xr-x 12 lshay staff 384 Oct 2 13:48 yannpapouin.theme-monolivia-1.0.3/ drwxr-xr-x 8 lshay staff 256 Oct 6 21:51 zrachod.mono-snippets-0.0.2/
Same here.
dotnet --info
Outils en ligne de commande .NET (2.0.0)
Product Information:
Version: 2.0.0
Commit SHA-1 hash: cdcd1928c9
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.12
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/2.0.0/
Microsoft .NET Core Shared Framework Host
Version : 2.0.0
Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
After updating to 2.0.2 using this https://download.microsoft.com/download/7/3/A/73A3E4DC-F019-47D1-9951-0453676E059B/dotnet-sdk-2.0.2-osx-gs-x64.pkg
omnisharp works again.
Only got one extension installed. After installing .Net SDK 2.0.2 as @ysris suggested I don't get the "failed to spawn dotnet" error anymore but Omnisharp is still not working
@Sebioff don't know if it can help you but now dotnet --info says
Outils en ligne de commande .NET (2.0.2)
Product Information:
Version: 2.0.2
Commit SHA-1 hash: a04b4bf512
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.12
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/2.0.2/
Microsoft .NET Core Shared Framework Host
Version : 2.0.0
Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
Is there anything interesting in the omnisharp log (vscode output, dropdown > omnisharplog) ?
I have .NET 2.0.2 installed. Omnisharp is not working and there is no dropdown->omnisharp in VSCODE output. Which make me think Omnisharp failed very early to start... but I don't know how to debug this.
FWIW, I have .NET Core SDK 2.0.2 installed as well.
Yes, it seems like the VS Code extension failed to activate. Could you try invoking the OmniSharp: Restart OmniSharp command in VS Code? Also, it might be worth toggling the Developer Tools in VS Code and see if anything useful appears in the console when launching.
The Restart Omnisharp command does nothing at all from what I can tell. Both the developer tools console and VSCode output are empty.
Restarting OmniSharp doesn't do anything. Also "OmniSharp: Select Project" shows 0 projects. How do I toggle the Developer Tools in VS Code? Thanks.
Help->Toggle Developer Tools
I'm getting this Error on the Developer Tools Console: Unable to write to User Settings because sync.version is not a registered configuration.: Error: Unable to write to User Settings because sync.version is not a registered configuration.
Not sure if it's related.
Restart Omnisharp doesn't work for me too on 1.18, output and developer tools console are empty.
Same thing. Stop working on 1.18 Updating .NET Core SDK to 2.0.2 fixed the problem (it was 1.0.0).
Note that the version of VS Code (1.18) is orthogonal to the version of C# for VS Code that you have installed (the latest is 1.13.1)
Yes, C# for VS Code version 1.13.1 is installed. Any further logs to check or things to try? I'll gladly provide and test anything that might help resolve this.
Same problem. Stop working on 1.18 and no omnisharp log ouput
dotnet --info
.NET Command Line Tools (2.0.2)
Product Information:
Version: 2.0.2
Commit SHA-1 hash: a04b4bf512
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.12
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/2.0.2/
Microsoft .NET Core Shared Framework Host
Version : 2.0.0
Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
I try it with the insider preview of vscode (1.19) and all working fine. Perhaps a problem with vscode 1.18?
Does Omnisharp has any logs it produces that I can look at? If yes, where are they located in Mac?
@shalevy2888
- In VS Code, select View->Output to bring up the Output pane.
- In the Output pane, select "OmniSharp Log" from the combobox in the top-right corner.
Sorry for the confusion. Right now Omnisharp doesn't even start (I suspect) so there is no log inside of VSCode. Omnisharp isn't part of the dropbox. From the thread I understand others are experiencing the same.
My question was of other logs, in some local folder on my drive that I can look at...
I would be interested to know if there is even a .debugger or .omnisharp folder in the ~./vscode/extensions/ms-vscode-csharp.<version> directory on your machine. If there isn't, the extension hasn't even activated and downloaded the debugger or OmniSharp.
Yes, both folders exist and contain a whole bunch of dlls and the Omnisharp/debugger exes
Yes, they exist. If I remove the extension and reload vscode and than install and reload, both OmniSharp and .Net are downloaded and installed. But other than that I don't see any logs...
@shalevy2888 : You're on OSX, right? Could you try running the following command in a Terminal window?
> ~/.vscode/extensions/ms-vscode.csharp-<version>/.omnisharp/run --stdio -s <path-to-your-project-folder>
Let me know the output.
Here is what I get when running the above command (sorry for the long log). I do see this message inside: Omnisharp server running using Stdio at location.
~/.vscode/extensions/ms-vscode.csharp-1.13.1/.omnisharp/run --stdio -s ~/Dropbox/Develpment/Unity/ColorNLight/
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Stdio.Host","Message":"Starting OmniSharp on MacOS 10.13.1 (x64)"},"Seq":1,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.Discovery.MSBuildLocator","Message":"Located 1 MSBuild instance(s)\n 1: StandAlone 15.0 - \"/Users/lshay/.vscode/extensions/ms-vscode.csharp-1.13.1/.omnisharp/omnisharp/msbuild/15.0/Bin\""},"Seq":2,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.Discovery.MSBuildLocator","Message":"MSBUILD_EXE_PATH environment variable set to '/Users/lshay/.vscode/extensions/ms-vscode.csharp-1.13.1/.omnisharp/omnisharp/msbuild/15.0/Bin/MSBuild.dll'"},"Seq":3,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.Discovery.MSBuildLocator","Message":"Registered MSBuild instance: StandAlone 15.0 - \"/Users/lshay/.vscode/extensions/ms-vscode.csharp-1.13.1/.omnisharp/omnisharp/msbuild/15.0/Bin\"\n MSBuildExtensionsPath = /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/xbuild\n CscToolPath = /Users/lshay/.vscode/extensions/ms-vscode.csharp-1.13.1/.omnisharp/omnisharp/msbuild/15.0/Bin/Roslyn\n CscToolExe = csc.exe\n MSBuildToolsPath = /Users/lshay/.vscode/extensions/ms-vscode.csharp-1.13.1/.omnisharp/omnisharp/msbuild/15.0/Bin\n TargetFrameworkRootPath = /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/xbuild-frameworks"},"Seq":4,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Cake.CakeProjectSystem","Message":"Detecting Cake files in '/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/'."},"Seq":5,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Cake.CakeProjectSystem","Message":"Could not find any Cake files"},"Seq":6,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.DotNet.DotNetProjectSystem","Message":"Initializing in /Users/lshay/Dropbox/Develpment/Unity/ColorNLight/"},"Seq":7,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.DotNet.DotNetProjectSystem","Message":"Auto package restore: False"},"Seq":8,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.DotNet.DotNetProjectSystem","Message":"Update workspace context"},"Seq":9,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.DotNet.DotNetProjectSystem","Message":"Resolving projects references"},"Seq":10,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.MSBuildProjectSystem","Message":"Detecting projects in '/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/ColorNLight.sln'."},"Seq":11,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.MSBuildProjectSystem","Message":"Loading project: /Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Assembly-CSharp.csproj"},"Seq":12,"Type":"event"}
{"Event":"MsBuildProjectDiagnostics","Body":{"FileName":"/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Assembly-CSharp.csproj","Warnings":[],"Errors":[]},"Seq":13,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.MSBuildProjectSystem","Message":"Loading project: /Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Assembly-CSharp-Editor.csproj"},"Seq":14,"Type":"event"}
{"Event":"MsBuildProjectDiagnostics","Body":{"FileName":"/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Assembly-CSharp-Editor.csproj","Warnings":[],"Errors":[]},"Seq":15,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.MSBuildProjectSystem","Message":"Update project: Assembly-CSharp"},"Seq":16,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.MSBuildProjectSystem","Message":"Update project: Assembly-CSharp-Editor"},"Seq":17,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"WARNING","Name":"OmniSharp.MSBuild.MSBuildProjectSystem","Message":"Unable to resolve assembly '/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Temp/bin/Debug/Assembly-CSharp.dll'"},"Seq":18,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Script.ScriptProjectSystem","Message":"Detecting CSX files in '/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/'."},"Seq":19,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Script.ScriptProjectSystem","Message":"Could not find any CSX files"},"Seq":20,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Stdio.Host","Message":"Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider"},"Seq":21,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Stdio.Host","Message":"Configuration finished."},"Seq":22,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Stdio.Host","Message":"Omnisharp server running using Stdio at location '/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/' on host -1."},"Seq":23,"Type":"event"}
{"Event":"started","Body":null,"Seq":24,"Type":"event"}
{"Event":"ProjectAdded","Body":{"MsBuildProject":{"ProjectGuid":"73600f25-338e-5abc-f8d5-ddd73694da22","Path":"/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Assembly-CSharp.csproj","AssemblyName":"Assembly-CSharp","TargetPath":"/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Temp/bin/Debug/Assembly-CSharp.dll","TargetFramework":".NETFramework,Version=v2.0","SourceFiles":["/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Assets/cui_color_picker-master/Assets/CUIColorPicker.cs","/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Assets/Scripts/AutoHide.cs","/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Assets/Scripts/ImageSlider.cs","/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Assets/Scripts/ScreenColor.cs","/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Assets/Scripts/SwatchColor.cs"],"TargetFrameworks":[],"OutputPath":"Temp\\bin\\Debug\\","IsExe":false,"IsUnityProject":true}},"Seq":25,"Type":"event"}
{"Event":"ProjectAdded","Body":{"MsBuildProject":{"ProjectGuid":"2e04984d-a81f-05db-8fb0-29b7c01cb034","Path":"/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Assembly-CSharp-Editor.csproj","AssemblyName":"Assembly-CSharp-Editor","TargetPath":"/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Temp/bin/Debug/Assembly-CSharp-Editor.dll","TargetFramework":".NETFramework,Version=v2.0","SourceFiles":["/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Assets/VSCode/Plugins/Editor/VSCode.cs"],"TargetFrameworks":[],"OutputPath":"Temp\\bin\\Debug\\","IsExe":false,"IsUnityProject":true}},"Seq":26,"Type":"event"}
{"Event":"ProjectChanged","Body":{"MsBuildProject":{"ProjectGuid":"73600f25-338e-5abc-f8d5-ddd73694da22","Path":"/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Assembly-CSharp.csproj","AssemblyName":"Assembly-CSharp","TargetPath":"/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Temp/bin/Debug/Assembly-CSharp.dll","TargetFramework":".NETFramework,Version=v2.0","SourceFiles":["/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Assets/cui_color_picker-master/Assets/CUIColorPicker.cs","/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Assets/Scripts/AutoHide.cs","/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Assets/Scripts/ImageSlider.cs","/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Assets/Scripts/ScreenColor.cs","/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Assets/Scripts/SwatchColor.cs"],"TargetFrameworks":[],"OutputPath":"Temp\\bin\\Debug\\","IsExe":false,"IsUnityProject":true}},"Seq":27,"Type":"event"}
{"Event":"ProjectChanged","Body":{"MsBuildProject":{"ProjectGuid":"2e04984d-a81f-05db-8fb0-29b7c01cb034","Path":"/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Assembly-CSharp-Editor.csproj","AssemblyName":"Assembly-CSharp-Editor","TargetPath":"/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Temp/bin/Debug/Assembly-CSharp-Editor.dll","TargetFramework":".NETFramework,Version=v2.0","SourceFiles":["/Users/lshay/Dropbox/Develpment/Unity/ColorNLight/Assets/VSCode/Plugins/Editor/VSCode.cs"],"TargetFrameworks":[],"OutputPath":"Temp\\bin\\Debug\\","IsExe":false,"IsUnityProject":true}},"Seq":28,"Type":"event"}
Great! It looks like the problem isn't with OmniSharp itself and it loads your Unity projects correctly. Instead, it seems that the C# extension isn't triggering on your machine for some reason. @jrieken, do you know of any issues in VS Code 1.18 above extension loading?
@jrieken, do you know of any issues in VS Code 1.18 above extension loading?
What would be pretty bad news to me. Adding @sandy081 who owns the extension installing and loading.
Thanks @jrieken! @sandy081: Do you have any tricks for debugging an extension not loading?
Got it to work!!!
- I got a weird error while doing global find in VSCODE, something about error parsing glob. Found a solution online: https://github.com/Microsoft/vscode/issues/25923 which indicate I might be excluding more file types than I should.
- I removed the *.sln exclude from my settings and it solved the global find problem. I then thought it might be related...
- I uninstalled c# extension, reloaded VSCODE. Installed again, reloaded, let the extension download and install Omnisharp - and it works!
This exclude isn't new in my settings and it was working without a problem in the previous version of VSCODE. So I'm guessing they changed something and it caused the extension to fail as well.
I would have thought the exclude feature of VSCODE is cosmetic only, just what to show or not show in the file browser, but it has too much hidden functionality. I guess I'm going to remove all the excludes.
Thanks all for trying to help. I wonder if this fixes the issue for the other people in this thread.
Shay
Yes! Awesome :)
Didn't even need to uninstall/reinstall Omnisharp, just had to find and remove the problematic exclude.
In my case it was "**/**.prefab": true,