dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.85k stars 670 forks source link

OmniSharp server times out when using WSL extension #4092

Open ChrisKlug opened 4 years ago

ChrisKlug commented 4 years ago

Issue Description

When I load a project in Code using the WSL extension, the C# extension does not work at all. Looking at the OmniSharp log, it seems to fail to load.

Starting OmniSharp server at 9/29/2020, 2:56:42 PM
    Target: /home/zerokoll/code/temp/mvc-test

OmniSharp server started.
    Path: /home/zerokoll/.vscode-server/extensions/ms-dotnettools.csharp-1.23.2/.omnisharp/1.37.1/run
    PID: 16672

your 131072x1 screen size is bogus. expect trouble
your 131072x1 screen size is bogus. expect trouble
xargs: unmatched double quote; by default quotes are special to xargs unless you use the -0 option
[ERROR] Error: OmniSharp server load timed out. Use the 'omnisharp.projectLoadTimeout' setting to override the default delay (one minute).

Looking at previous issues, I have seen that the "bogus screen size" output was supposed to be fixed, but is showing up here. But it does not seem to be the reason for it failing.

Steps to Reproduce

Locally, it is reproduced loading any project using WSL.

Expected Behavior

OmniSharp server starts up and provides C# editing experience as expected.

Actual Behavior

C# editing does not work at all.

Logs

OmniSharp log

Starting OmniSharp server at 9/29/2020, 3:04:20 PM Target: /home/zerokoll/code/temp/mvc-test OmniSharp server started. Path: /home/zerokoll/.vscode-server/extensions/ms-dotnettools.csharp-1.23.2/.omnisharp/1.37.1/run PID: 17640 your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble xargs: unmatched double quote; by default quotes are special to xargs unless you use the -0 option

C# log

Empty

Environment information

VSCode version: 1.49.2 C# Extension: 1.23.2

Mono Information OmniSharp using built-in mono
Dotnet Information .NET SDK (reflecting any global.json): Version: 5.0.100-rc.1.20452.10 Commit: 473d1b592e Runtime Environment: OS Name: ubuntu OS Version: 18.04 OS Platform: Linux RID: ubuntu.18.04-x64 Base Path: /usr/share/dotnet/sdk/5.0.100-rc.1.20452.10/ Host (useful for support): Version: 5.0.0-rc.1.20451.14 Commit: 38017c3935 .NET SDKs installed: 5.0.100-rc.1.20452.10 [/usr/share/dotnet/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 5.0.0-rc.1.20451.17 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 5.0.0-rc.1.20451.14 [/usr/share/dotnet/shared/Microsoft.NETCore.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download
Visual Studio Code Extensions |Extension|Author|Version| |---|---|---| |csharp|ms-dotnettools|1.23.2| |vs-sharper|eservice-online|0.2.0|;
pietervdheijden-calvi commented 3 years ago

Any update on this?

Suddenly, I have the same issue... Before it worked just fine. I'm not sure what changed...

Dalmazox commented 3 years ago

I have this same issue.

OS: Windows 21H1 19043.1165 WSL2: Ubuntu 20.04.3 LTS Kernel: 5.4.72-microsoft-standard-WSL2 Extension: 1.23.14

It works normally in Windows environment, however when using WSL2, the error below happens.

Starting OmniSharp server at 8/30/2021, 7:21:58 PM
    Target: /home/dalmazo/dev/Mediador/Mediador.sln

OmniSharp server started.
    Path: /home/dalmazo/.vscode-server/extensions/ms-dotnettools.csharp-1.23.14/.omnisharp/1.37.14/run
    PID: 4645

your 131072x1 screen size is bogus. expect trouble
your 131072x1 screen size is bogus. expect trouble
xargs: unmatched double quote; by default quotes are special to xargs unless you use the -0 option
[ERROR] Error: OmniSharp server load timed out. Use the 'omnisharp.projectLoadTimeout' setting to override the default delay (one minute).
crisperit commented 2 years ago

Hello - I've had the same problem and resolved it in here https://github.com/Dart-Code/Dart-Code/issues/3680

In mine case the problem was that WSL has a feature of passing env vars between Windows and Linux via WSLENV

By default it has set BASH_ENV to /etc/bash.bashrc

In mine case I was keeping all bash configs inside of mine /home/<user>/.zshrc

After removing BASH_ENV everything has started to work again