dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.88k stars 676 forks source link

Omnisharp doesn't work, VSCode output doesn't even include Omnisharp in the dropdown list #1867

Closed shalevy2888 closed 2 weeks ago

shalevy2888 commented 7 years ago

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: 1) opening many different projects 2) Removing and installing the extension 3) removing and installing VSCODE 4) Installing Mono and dotnet again and again :) 5) 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

Sebioff commented 7 years ago

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

DustinCampbell commented 7 years ago

Could you check your ~/.vscode/extensions folder (%UserProfile%\.vscode\extensions on Windows) and ensure there's just a single ms-vscode.csharp-* extension installed?

shalevy2888 commented 7 years ago

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/

ysris commented 7 years ago

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.

Sebioff commented 7 years ago

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

ysris commented 7 years ago

@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) ?

shalevy2888 commented 7 years ago

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.

DustinCampbell commented 7 years ago

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.

Sebioff commented 7 years ago

The Restart Omnisharp command does nothing at all from what I can tell. Both the developer tools console and VSCode output are empty.

shalevy2888 commented 7 years ago

Restarting OmniSharp doesn't do anything. Also "OmniSharp: Select Project" shows 0 projects. How do I toggle the Developer Tools in VS Code? Thanks.

DustinCampbell commented 7 years ago

Help->Toggle Developer Tools

shalevy2888 commented 7 years ago

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.

dz4va commented 7 years ago

Restart Omnisharp doesn't work for me too on 1.18, output and developer tools console are empty.

dy-sh commented 7 years ago

Same thing. Stop working on 1.18 Updating .NET Core SDK to 2.0.2 fixed the problem (it was 1.0.0).

DustinCampbell commented 7 years ago

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)

Sebioff commented 7 years ago

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.

Blist commented 7 years ago

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?

shalevy2888 commented 7 years ago

Does Omnisharp has any logs it produces that I can look at? If yes, where are they located in Mac?

SIkebe commented 7 years ago

@shalevy2888

  1. In VS Code, select View->Output to bring up the Output pane.
  2. In the Output pane, select "OmniSharp Log" from the combobox in the top-right corner.
shalevy2888 commented 7 years ago

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...

DustinCampbell commented 7 years ago

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.

Sebioff commented 7 years ago

Yes, both folders exist and contain a whole bunch of dlls and the Omnisharp/debugger exes

shalevy2888 commented 7 years ago

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...

DustinCampbell commented 7 years ago

@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.

shalevy2888 commented 7 years ago

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"}
DustinCampbell commented 7 years ago

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 commented 7 years ago

@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.

DustinCampbell commented 7 years ago

Thanks @jrieken! @sandy081: Do you have any tricks for debugging an extension not loading?

shalevy2888 commented 7 years ago

Got it to work!!!

  1. 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.
  2. I removed the *.sln exclude from my settings and it solved the global find problem. I then thought it might be related...
  3. 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

Sebioff commented 7 years ago

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,

ccbentlee commented 7 years ago

@DustinCampbell Hi, I have the save problem here and doesn't solve now. here is my environments: 1.macos 10.13 2.vscode 1.18.1 3.C# 1.13.1 4.mono 5.4.1.6 5..NET Command Line Tools (2.0.3) I think i update them all to the newest version :D I work with Unity 5. As they talked, I open my Unity project as usual, the omnisharp doesn't work so there is on dropdown in OUTPUT of omnisharp. I run the command you said, here is output and i didn't exclude *.sln and other type of files, there is no change before or after i update vscode to 1.18.1, it just didn't work. if you need other infomation just let me know. BTW, there is another problem: the unity project works fine in windows10 with vscode, but after i update to the newest version, it often open two windows when i open my project within unity and always, always tell me to save "workspace configuration as a file", but i have no clue what it is and don't know how to disable it . i guess maybe it's the new multi-root workspaces feature cause this problem.

~/.vscode/extensions/ms-vscode.csharp-1.13.1/.omnisharp/run --stdio -s /Users/Lee/Unity/DreamFactory                     1 ↵  5327  13:55:11
{"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/Lee/.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/Lee/.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/Lee/.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/Lee/.vscode/extensions/ms-vscode.csharp-1.13.1/.omnisharp/omnisharp/msbuild/15.0/Bin/Roslyn\n            CscToolExe = csc.exe\n            MSBuildToolsPath = /Users/Lee/.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/Lee/Unity/DreamFactory'."},"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/Lee/Unity/DreamFactory"},"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/Lee/Unity/DreamFactory/DreamFactory.sln'."},"Seq":11,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.MSBuildProjectSystem","Message":"Loading project: /Users/Lee/Unity/DreamFactory/Assembly-CSharp.csproj"},"Seq":12,"Type":"event"}
{"Event":"MsBuildProjectDiagnostics","Body":{"FileName":"/Users/Lee/Unity/DreamFactory/Assembly-CSharp.csproj","Warnings":[],"Errors":[]},"Seq":13,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.MSBuildProjectSystem","Message":"Update project: Assembly-CSharp"},"Seq":14,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Script.ScriptProjectSystem","Message":"Detecting CSX files in '/Users/Lee/Unity/DreamFactory'."},"Seq":15,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Script.ScriptProjectSystem","Message":"Could not find any CSX files"},"Seq":16,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Stdio.Host","Message":"Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider"},"Seq":17,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Stdio.Host","Message":"Configuration finished."},"Seq":18,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Stdio.Host","Message":"Omnisharp server running using Stdio at location '/Users/Lee/Unity/DreamFactory' on host -1."},"Seq":19,"Type":"event"}
{"Event":"started","Body":null,"Seq":20,"Type":"event"}
535;1R{"Event":"ProjectAdded","Body":{"MsBuildProject":{"ProjectGuid":"3c48e662-2721-6c4d-4e31-1bfc9d126d35","Path":"/Users/Lee/Unity/DreamFactory/Assembly-CSharp.csproj","AssemblyName":"Assembly-CSharp","TargetPath":"/Users/Lee/Unity/DreamFactory/Temp/bin/Debug/Assembly-CSharp.dll","TargetFramework":".NETFramework,Version=v3.5","SourceFiles":["/Users/Lee/Unity/DreamFactory/Assets/FunctionScript/AutoBreathEffect.cs","/Users/Lee/Unity/DreamFactory/Assets/FunctionScript/MainOperater.cs","/Users/Lee/Unity/DreamFactory/Assets/FunctionScript/PlayMovie.cs","/Users/Lee/Unity/DreamFactory/Assets/FunctionScript/SceneController.cs","/Users/Lee/Unity/DreamFactory/Assets/FunctionScript/SelectElement.cs","/Users/Lee/Unity/DreamFactory/Assets/FunctionScript/SelectSystem.cs","/Users/Lee/Unity/DreamFactory/Assets/FunctionScript/SoundManager.cs","/Users/Lee/Unity/DreamFactory/Assets/FunctionScript/StandbyScript.cs","/Users/Lee/Unity/DreamFactory/Assets/FunctionScript/VideoPlayerController.cs","/Users/Lee/Unity/DreamFactory/Assets/RemoteControl/MyNetworkDiscovery.cs","/Users/Lee/Unity/DreamFactory/Assets/RemoteControl/MyNetworkManager.cs","/Users/Lee/Unity/DreamFactory/Assets/RemoteControl/MyPlayerController.cs"],"TargetFrameworks":[],"OutputPath":"Temp\\bin\\Debug\\","IsExe":false,"IsUnityProject":true}},"Seq":21,"Type":"event"}
{"Event":"ProjectChanged","Body":{"MsBuildProject":{"ProjectGuid":"3c48e662-2721-6c4d-4e31-1bfc9d126d35","Path":"/Users/Lee/Unity/DreamFactory/Assembly-CSharp.csproj","AssemblyName":"Assembly-CSharp","TargetPath":"/Users/Lee/Unity/DreamFactory/Temp/bin/Debug/Assembly-CSharp.dll","TargetFramework":".NETFramework,Version=v3.5","SourceFiles":["/Users/Lee/Unity/DreamFactory/Assets/FunctionScript/AutoBreathEffect.cs","/Users/Lee/Unity/DreamFactory/Assets/FunctionScript/MainOperater.cs","/Users/Lee/Unity/DreamFactory/Assets/FunctionScript/PlayMovie.cs","/Users/Lee/Unity/DreamFactory/Assets/FunctionScript/SceneController.cs","/Users/Lee/Unity/DreamFactory/Assets/FunctionScript/SelectElement.cs","/Users/Lee/Unity/DreamFactory/Assets/FunctionScript/SelectSystem.cs","/Users/Lee/Unity/DreamFactory/Assets/FunctionScript/SoundManager.cs","/Users/Lee/Unity/DreamFactory/Assets/FunctionScript/StandbyScript.cs","/Users/Lee/Unity/DreamFactory/Assets/FunctionScript/VideoPlayerController.cs","/Users/Lee/Unity/DreamFactory/Assets/RemoteControl/MyNetworkDiscovery.cs","/Users/Lee/Unity/DreamFactory/Assets/RemoteControl/MyNetworkManager.cs","/Users/Lee/Unity/DreamFactory/Assets/RemoteControl/MyPlayerController.cs"],"TargetFrameworks":[],"OutputPath":"Temp\\bin\\Debug\\","IsExe":false,"IsUnityProject":true}},"Seq":22,"Type":"event"}
ccbentlee commented 6 years ago

I found a solution to my problem, in "user settings" ->"files.exclude", i set "/.prefab" and "**.bin" to false instead of true before, it works again! I don't konw why but if you have the same problem you can check if you have the same settings as mine.

DustinCampbell commented 6 years ago

FWIW, I believe this is a VS Code issue around extensions that activate on wildcards (such as .csproj or .sln) that was introduced in VS Code 1.18. It seems that something has changed in VS Code 1.19-insiders to address the problem.

ccbentlee commented 6 years ago

@DustinCampbell I tried 1.19-insiders, same error as 1.18, all these two version works after i set "/.prefab" and "**.bin" to false.

vavane-ms commented 6 years ago

I have the same problem on Windows with VS Code 1.19.2 / 1.20.0-insider and ms-vscode.csharp 1.13.1. Completions are missing. Here's my dotnet info:

.NET Command Line Tools (2.1.4)

Product Information:
 Version:            2.1.4
 Commit SHA-1 hash:  5e8add2190

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.17025
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.1.4\

Microsoft .NET Core Shared Framework Host
  Version  : 2.0.5
  Build    : 17373eb129b3b05aa18ece963f8795d65ef8ea54

Here's what I see in Log (Extension Host):

[2018-01-17 14:24:10.354] [exthost1] [info] extension host started
[2018-01-17 14:24:10.393] [exthost1] [info] ExtensionService#_doActivateExtension vscode.emmet {"startup":true,"activationEvent":"*"}
[2018-01-17 14:24:10.393] [exthost1] [info] ExtensionService#loadCommonJSModule c:\Program Files\Microsoft VS Code Insiders\resources\app\extensions\emmet\out\extension
[2018-01-17 14:24:10.669] [exthost1] [info] ExtensionService#_doActivateExtension vscode.git {"startup":true,"activationEvent":"*"}
[2018-01-17 14:24:10.669] [exthost1] [info] ExtensionService#loadCommonJSModule c:\Program Files\Microsoft VS Code Insiders\resources\app\extensions\git\out\main
[2018-01-17 14:24:10.884] [exthost1] [info] ExtensionService#_doActivateExtension vscode.merge-conflict {"startup":true,"activationEvent":"*"}
[2018-01-17 14:24:10.884] [exthost1] [info] ExtensionService#loadCommonJSModule c:\Program Files\Microsoft VS Code Insiders\resources\app\extensions\merge-conflict\out\extension
[2018-01-17 14:24:10.952] [exthost1] [info] ExtensionService#_doActivateExtension ms-vscode.csharp {"startup":false,"activationEvent":"onLanguage:csharp"}
[2018-01-17 14:24:10.952] [exthost1] [info] ExtensionService#loadCommonJSModule C:\Users\vavane\.vscode-insiders\extensions\ms-vscode.csharp-1.13.1\out\src\main
[2018-01-17 14:24:12.856] [exthost1] [info] eager extensions activated

I don't see any problems if I run OmniSharp directly:

C:\Users\vavane>.vscode\extensions\ms-vscode.csharp-1.13.1\.omnisharp\OmniSharp.exe --stdio --source C:\Users\vavane\OneDrive\rosalind
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Stdio.Host","Message":"Starting OmniSharp on Windows 6.2.9200.0 (x64)"},"Seq":1,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.Discovery.MSBuildLocator","Message":"Located 2 MSBuild instance(s)\r\n            1: Visual Studio Enterprise 2017 15.4.27004.2010 - \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\MSBuild\\15.0\\Bin\"\r\n            2: StandAlone 15.0 - \"C:\\Users\\vavane\\.vscode\\extensions\\ms-vscode.csharp-1.13.1\\.omnisharp\\msbuild\\15.0\\Bin\""},"Seq":2,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.Discovery.MSBuildLocator","Message":"Registered MSBuild instance: Visual Studio Enterprise 2017 15.4.27004.2010 - \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\MSBuild\\15.0\\Bin\""},"Seq":3,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Cake.CakeProjectSystem","Message":"Detecting Cake files in 'C:\\Users\\vavane\\OneDrive\\rosalind'."},"Seq":4,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Cake.CakeProjectSystem","Message":"Could not find any Cake files"},"Seq":5,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.DotNet.DotNetProjectSystem","Message":"Initializing in C:\\Users\\vavane\\OneDrive\\rosalind"},"Seq":6,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.DotNet.DotNetProjectSystem","Message":"Auto package restore: False"},"Seq":7,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.DotNet.DotNetProjectSystem","Message":"Update workspace context"},"Seq":8,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.DotNet.DotNetProjectSystem","Message":"Resolving projects references"},"Seq":9,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.MSBuildProjectSystem","Message":"No solution files found in 'C:\\Users\\vavane\\OneDrive\\rosalind'"},"Seq":10,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.MSBuildProjectSystem","Message":"Loading project: C:\\Users\\vavane\\OneDrive\\rosalind\\rosalind.csproj"},"Seq":11,"Type":"event"}
{"Event":"MsBuildProjectDiagnostics","Body":{"FileName":"C:\\Users\\vavane\\OneDrive\\rosalind\\rosalind.csproj","Warnings":[],"Errors":[]},"Seq":12,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.MSBuildProjectSystem","Message":"Update project: rosalind"},"Seq":13,"Type":"event"}
{"Event":"UnresolvedDependencies","Body":{"FileName":"C:\\Users\\vavane\\OneDrive\\rosalind\\rosalind.csproj","UnresolvedDependencies":[{"Name":"Microsoft.NETCore.App","Version":"[2.0.0, )"}]},"Seq":14,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Script.ScriptProjectSystem","Message":"Detecting CSX files in 'C:\\Users\\vavane\\OneDrive\\rosalind'."},"Seq":15,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Script.ScriptProjectSystem","Message":"Could not find any CSX files"},"Seq":16,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Stdio.Host","Message":"Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider"},"Seq":17,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Stdio.Host","Message":"Configuration finished."},"Seq":18,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Stdio.Host","Message":"Omnisharp server running using Stdio at location 'C:\\Users\\vavane\\OneDrive\\rosalind' on host -1."},"Seq":19,"Type":"event"}
{"Event":"started","Body":null,"Seq":20,"Type":"event"}
{"Event":"ProjectChanged","Body":{"MsBuildProject":{"ProjectGuid":"00000000-0000-0000-0000-000000000000","Path":"C:\\Users\\vavane\\OneDrive\\rosalind\\rosalind.csproj","AssemblyName":"rosalind","TargetPath":"C:\\Users\\vavane\\OneDrive\\rosalind\\bin\\Debug\\netcoreapp2.0\\rosalind.dll","TargetFramework":".NETCoreApp,Version=v2.0","SourceFiles":["C:\\Users\\vavane\\OneDrive\\rosalind\\Program.cs","C:\\Users\\vavane\\OneDrive\\rosalind\\Utils.cs","C:\\Users\\vavane\\AppData\\Local\\Temp\\.NETCoreApp,Version=v2.0.AssemblyAttributes.cs","C:\\Users\\vavane\\OneDrive\\rosalind\\obj\\Debug\\netcoreapp2.0\\rosalind.AssemblyInfo.cs"],"TargetFrameworks":[{"Name":".NETCoreApp","FriendlyName":".NETCoreApp","ShortName":"netcoreapp2.0"}],"OutputPath":"bin\\Debug\\netcoreapp2.0\\","IsExe":true,"IsUnityProject":false}},"Seq":21,"Type":"event"}
{"Event":"ProjectAdded","Body":{"MsBuildProject":{"ProjectGuid":"00000000-0000-0000-0000-000000000000","Path":"C:\\Users\\vavane\\OneDrive\\rosalind\\rosalind.csproj","AssemblyName":"rosalind","TargetPath":"C:\\Users\\vavane\\OneDrive\\rosalind\\bin\\Debug\\netcoreapp2.0\\rosalind.dll","TargetFramework":".NETCoreApp,Version=v2.0","SourceFiles":["C:\\Users\\vavane\\OneDrive\\rosalind\\Program.cs","C:\\Users\\vavane\\OneDrive\\rosalind\\Utils.cs","C:\\Users\\vavane\\AppData\\Local\\Temp\\.NETCoreApp,Version=v2.0.AssemblyAttributes.cs","C:\\Users\\vavane\\OneDrive\\rosalind\\obj\\Debug\\netcoreapp2.0\\rosalind.AssemblyInfo.cs"],"TargetFrameworks":[{"Name":".NETCoreApp","FriendlyName":".NETCoreApp","ShortName":"netcoreapp2.0"}],"OutputPath":"bin\\Debug\\netcoreapp2.0\\","IsExe":true,"IsUnityProject":false}},"Seq":22,"Type":"event"}

If that's a VS Code bug, where is it tracked?

vavane-ms commented 6 years ago

In case anyone else is wondering, my problem was solved by making OneDrive eagerly download files (even though OneDrive itself reported that the folder was downloaded completely). I will open a separate issue for that.

DustinCampbell commented 6 years ago

Thanks @grofie!

grofie commented 6 years ago

If you are using Unity and also have this problem too, please try out the fix I explained here and give me feedback if it is working for you too: https://github.com/dotBunny/VSCode/issues/165#issuecomment-394347070

(Sorry, my first attempt was not fully matured, but hopefully it is working now)

Novack commented 5 years ago

Got this issue... Im using latest VSCode (1.30.1) with corresponding Omnisharp (and Unity). After researching for a while, first removed the .sln and .csproj files from VSCode excluded files, but wasnt enough. After some extra research, found this thread and got it working by removing the .prefabs file extension from the exclusion list too (WTF?!? -excuse my french-, have no idea how that file type can break things down like that.

How come more than a year later and after so many versions we can end on such a critical issue again?

Thanks @Sebioff and anyone on this thread for the help.

rchande commented 5 years ago

@jrieken From what @Novack says it sounds like there may have been another regression in extension activation. Is VS Code tracking any issues? @Novack what is ".prefabs"? I can't find it in the VS Code extension store.

Novack commented 5 years ago

@rchande I meant extension as in file extension, not as in plugin. Sorry for the poor wording.

Prefabs are file types used in Unity3D engine, for content, not configuration. There should be no reason whatsoever why adding that file extension to the exclusion list should break onmisharp loading.

Thanks for checking.

mkyukov commented 5 years ago

Fresh install at latest version of Visual Studio Code and this doesn't work.

Same version on Elementary OS5 works just fine.

Gabrielrb340 commented 5 years ago

Hi ! I and my coworkers ive been searching for days and tryed everything but didnt worked, but we found a solution i dont really know if it will work for everyone . We had a really large workspace on linux and our intellisense wasnt working after update vs code and ominsharp(omnisharp log had some bugs etc) we tried set fs.inotify.max_user_watches=524288 but worked when we multiplied this value 4x setting fs.inotify.max_user_watches=2097152 it is worth try ! hope help someone !

jajodia-tushar commented 5 years ago

Guys, I did this and it started working.

I closed the VS Code Studio. Started it by Run as Administrator. .net restore .net generate assets for build and debug.

then start debugging

frankiee12a9 commented 3 years ago

Hello everyone, now I'm in trouble with this error, after searching a bunch of resources but still stuck on this! I tried the solutions you guys mentioned above, but none of them worked!

JoeRobich commented 3 years ago

@TKNguyen12a9 Can you please open a new issue and provide the information requested in the template? It would be helpful to know what type of project your are trying to open (Web, Unity, Console, etc...), does your code have a project file (.csproj) or solution (.sln), whether it can be built from the commandline with dotnet build, and anything else you think might be unique about your setup.

alanondra commented 5 months ago

This is still a problem. I'm running Garuda Linux. VS Code and C# extension are up-to-date, dotnet and omnisharp-roslyn are installed, I can run both dotnet and omnisharp commands without issue from a terminal.

This is a project that is freshly-built using dotnet commands and successfully runs with dotnet run. Running omnisharp in the directory shows that it successfully parses my project's directory structure without any errors.

The Language Server starts but there is no sign of Omnisharp anywhere in VS Code except a few configuration options. There are no command palette entries, there is no log selection in the Output palette, and autocompletion does not work.

I've tried manually setting the Omnisharp path to the output of which omnisharp and enabling the option to force on Omnisharp, and it causes an extremely vague message about the Language Server client failing to connect.

JoeRobich commented 2 weeks ago

A lot has changed with packaging and acquisition of necessary components since this issue was opened. If this is still an issue, please open a new issue with details.