Pengwin
Pengwin copied to clipboard
OmniSharp C# extension can't load netstandard in VS Code
Describe the bug When using VS Code from Windows to do remote development in Pengwin, the OmniSharp extension cannot load the "netstandard" assembly. OmniSharp provides Intellisense for C# code.
To Reproduce Steps to reproduce the behavior:
- Install Pengwin. At the time of writing, I'm pretty sure I was using 1.2.
- Install Dotnet Core with the Pengwin installer.
- Create new Dotnet project in Pengwin e.g. dotnet new angular
- Install VS Code (I have 1.35.1), the C# extension (1.20.0) and the Remote Development pack (0.15.0, Remote WSL 0.38.0)
- From Pengwin, start VS code in the folder containing the dotnet project.
- Install the C# extension in WSL. Restart VS Code.
- Watch the Output window for OmniSharp in VS Code. It will indicate an error.
Expected behavior OmniSharp loads and provides Intellisense in C# files.
Additional context The OmniSharp log:
Starting OmniSharp server at 2019-6-28 20:39:18
Target: /home/jmclachlan/angorig
OmniSharp server started with Mono 5.18.0.
Path: /home/jmclachlan/.vscode-server/extensions/ms-vscode.csharp-1.20.0/.omnisharp/1.32.20/omnisharp/OmniSharp.exe
PID: 24154
System.IO.FileNotFoundException: Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.
File name: 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
at OmniSharp.CommandLineApplication+<>c__DisplayClass11_0.<OnExecute>b__0 () [0x0000b] in <ed3c9ce4e617450c93f057d2d4910269>:0
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute (System.String[] args) [0x00039] in <344a1e8cd6594b17b1e01f8df6ae8827>:0
at OmniSharp.CommandLineApplication.Execute (System.Collections.Generic.IEnumerable`1[T] args) [0x00042] in <ed3c9ce4e617450c93f057d2d4910269>:0
at OmniSharp.Stdio.Driver.Program+<>c__DisplayClass0_0.<Main>b__0 () [0x00028] in <8c53cc66f1ca4f63a09ec8173bd47c77>:0
at OmniSharp.HostHelpers.Start (System.Func`1[TResult] action) [0x0001c] in <ed3c9ce4e617450c93f057d2d4910269>:0
[ERROR] Error: OmniSharp server load timed out. Use the 'omnisharp.projectLoadTimeout' setting to override the default delay (one minute).
Basic Troubleshooting Checklist
[x] I have searched Google for the error message. Found suggestions to install .NET Framework 4.7.1, but that applies only to Windows. [x] I have checked official WSL troubleshooting documentation: https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#confirm-wsl-is-enabled. [x] I have searched the official Microsoft WSL issues page: https://github.com/Microsoft/WSL/issues. [x] I have searched the Pengwin issues page: https://github.com/WhitewaterFoundry/Pengwin/issues. [x] I have reset Pengwin: Settings->Apps->Apps & features->Pengwin->Advanced Options->Reset. [x] I have disabled and re-enabled WSL in Windows Features. [x] I have run Windows 10 updates and restarted.
What other troubleshooting have you attempted? Tried same steps in Ubuntu 16.04 for WSL, which loads (though not using Mono). Tried installing dotnet using the steps for Debian 9 instead of the Pengwin installer, but that failed.
Pengwin Version
Find: Settings->Apps->Apps & features->Pengwin->Advanced Options->Version.
Insert here: 1.2.5
Windows Build
Run 'systeminfo | findstr /C:"OS"' in Command Prompt and insert here: OS Name: Microsoft Windows 10 Pro OS Version: 10.0.18362 N/A Build 18362 OS Manufacturer: Microsoft Corporation OS Configuration: Standalone Workstation OS Build Type: Multiprocessor Free BIOS Version: LENOVO G5ETB3WW (2.73 ), 11/28/2018
For help on retrieving: https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#check-your-build-number
I tried to run the angular app, but it needed node, which I hadn't installed. I created a console app with "dotnet new console" and "dotnet run" executes properly.
@claq2 did you manage to fix this?
No, I never found a fix.
@claq2 check this: https://github.com/OmniSharp/omnisharp-vscode/issues/3265
The
"omnisharp.useGlobalMono": "never"
setting got it working. I tried installing Mono 6.40 with the steps on https://www.mono-project.com/download/stable/#download-lin-debian but Pengwin now seems to be based on the unreleased Debian 11, for which Mono doesn't have a feed/source.
As an aside, using a released version of Debian for Pengwin might give folks more options for support. I'm guessing this solved other problems. (Maybe there's something I'm missing but I can't find a way to install mono 6.40 on it.)
Hello,
To install mono 6.8 follow the instructions in the above link but specify the repository from which you will get the packages:
sudo apt install -t stable-buster mono-devel
The complete instructions:
sudo apt install apt-transport-https dirmngr gnupg ca-certificates
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/debian stable-buster main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update
sudo apt install -t stable-buster mono-devel
That worked. Now OmniSharp starts with "omnisharp.useGlobalMono": "auto" and says it's using Mono 6.8. Thanks! I leave it up to you folks if you want to close this or not. But it would be nice if Pengwin included a recent version of Mono to prevent this.
An update: mono 6.8 now can be installed using plain apt install mono-devel without adding any extra repositories:
