Closed vchirikov closed 2 years ago
Found out that I need rights + gcompat
and bash
to run mono and omnisharp, but I still get
Unknown language in `contributes.csharp.language`. Provided value: csharp
error, although omnisharp is working:
Starting OmniSharp server at 9/3/2021, 12:23:35 PM
Target: /_workspace/_dumps.sln
OmniSharp server started.
Path: /root/.vscode-server/extensions/ms-dotnettools.csharp-1.23.15/.omnisharp/1.37.15/run
PID: 6570
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on alpine 3.13.6 (x64)
[info]: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 17.0.0 - "/root/.vscode-server/extensions/ms-dotnettools.csharp-1.23.15/.omnisharp/1.37.15/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/root/.vscode-server/extensions/ms-dotnettools.csharp-1.23.15/.omnisharp/1.37.15/omnisharp/.msbuild/Current/Bin/MSBuild.exe'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 17.0.0 - "/root/.vscode-server/extensions/ms-dotnettools.csharp-1.23.15/.omnisharp/1.37.15/omnisharp/.msbuild/Current/Bin"
CscToolExe = csc.exe
MSBuildToolsPath = /root/.vscode-server/extensions/ms-dotnettools.csharp-1.23.15/.omnisharp/1.37.15/omnisharp/.msbuild/Current/Bin
CscToolPath = /root/.vscode-server/extensions/ms-dotnettools.csharp-1.23.15/.omnisharp/1.37.15/omnisharp/.msbuild/Current/Bin/Roslyn
BypassFrameworkInstallChecks = true
MSBuildExtensionsPath = /root/.vscode-server/extensions/ms-dotnettools.csharp-1.23.15/.omnisharp/1.37.15/omnisharp/.msbuild
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/_workspace'.
[info]: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
Detecting projects in '/_workspace/_dumps.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/_workspace/clrmd/clrmd.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/_workspace'.
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /_workspace/clrmd/clrmd.csproj
[info]: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
Configuration finished.
[info]: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/_workspace' on host 6265.
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/_workspace/clrmd/clrmd.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Adding project '/_workspace/clrmd/clrmd.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Update project: clrmd
@nohwnd, now I use official bootstrap scripts microsoft/vscode-dev-containers and C# extension loads correctly (you still need to install gcompat
on Alpine though).
For history, the solution is here: https://github.com/vchirikov/dotnet-dumps-devcontainer
Perfect, thanks for letting me know. We looked at this in our triage yesterday, and were surprised by this error: Unknown language in
contributes.csharp.language. Provided value: csharp
because that looks like something that should not happen.
/fyi @JoeRobich
@nohwnd , @JoeRobich looks like the same problem on 3.16 alpine even with gcompat
+ https://raw.githubusercontent.com/microsoft/vscode-dev-containers/main/script-library/common-alpine.sh
:
The "[ERROR]: C# Extension failed to get platform information." error is useful.
That errors is thrown early during activation: https://github.com/OmniSharp/omnisharp-vscode/blob/88ad237e1e904ad0f91d2de39c30132198a02dcb/src/main.ts#L59-L66
GetCurrent platform checks specific things on Linux platforms: https://github.com/OmniSharp/omnisharp-vscode/blob/88ad237e1e904ad0f91d2de39c30132198a02dcb/src/platform.ts#L148-L155
GetMusl should be handling exceptions: https://github.com/OmniSharp/omnisharp-vscode/blob/88ad237e1e904ad0f91d2de39c30132198a02dcb/src/platform.ts#L180-L188
GetArchitecture could be the source of this failure: https://github.com/OmniSharp/omnisharp-vscode/blob/88ad237e1e904ad0f91d2de39c30132198a02dcb/src/platform.ts#L172-L178
There was also a recent change to the locations where we look for os-release, although those errors should be caught and Unknown returned: https://github.com/OmniSharp/omnisharp-vscode/blob/88ad237e1e904ad0f91d2de39c30132198a02dcb/src/platform.ts#L24-L30
Please let me know if any of these look problematic for Alpine.
Inside the devcontainer based on 6.0.301-alpine3.16-amd64
> uname -m
x86_64
> ldd --version
musl libc (x86_64)
Version 1.2.3
Dynamic Program Loader
Usage: /lib/ld-musl-x86_64.so.1 [options] [--] pathname
> cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.16.0
PRETTY_NAME="Alpine Linux v3.16"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
Looks like the problem is here:
So vscode is runned under windows, but C# extension is in linux dev container and the extension doesn't support remote development.
Looks like some docs are here:
Supporting Remote Development and GitHub Codespaces | Visual Studio Code Extension API
@JoeRobich could you take a look at this?
@vchirikov When running a devcontainer the C# extension runs in the vscode-server process in the container. Will have to investigate why it is isWindows
is not defined.
Environment data
`dotnet --info` output:
``` b09f71e2c0a6:/_workspace# dotnet --info .NET SDK (reflecting any global.json): Version: 5.0.400 Commit: d61950f9bf Runtime Environment: OS Name: alpine OS Version: 3.13 OS Platform: Linux RID: linux-musl-x64 Base Path: /usr/share/dotnet/sdk/5.0.400/ Host (useful for support): Version: 5.0.9 Commit: 208e377a53 .NET SDKs installed: 5.0.400 [/usr/share/dotnet/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 5.0.9 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 5.0.9 [/usr/share/dotnet/shared/Microsoft.NETCore.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download ```VS Code version: 1.59.1 C# Extension version: v1.23.15
OmniSharp log
`"omnisharp.loggingLevel": "debug",`
``` Starting OmniSharp server at 9/3/2021, 11:20:48 AM Target: /_workspace/_dumps.sln OmniSharp server started. Path: /root/.vscode-server/extensions/ms-dotnettools.csharp-1.23.15/.omnisharp/1.37.15/run PID: 13284 [ERROR] Error: OmniSharp server load timed out. Use the 'omnisharp.projectLoadTimeout' setting to override the default delay (one minute). ```Steps to reproduce
dotnet new console
Expected behavior
Omnisharp is started under a dev container
Actual behavior
Omnisharp doesn't start.
Additional error output