dotnet / vscode-csharp

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

Microsoft.CodeAnalysis.LanguageServer client: couldn't create connection to server #7419

Open alberico-lima opened 3 months ago

alberico-lima commented 3 months ago

Environment data

dotnet --info output: .NET SDK: Version: 8.0.303 Commit: 29ab8e3268 Workload version: 8.0.300-manifests.c915c39d MSBuild version: 17.10.4+10fbfbf2e

Ambiente de runtime: OS Name: Windows OS Version: 10.0.22631 OS Platform: Windows RID: win-x64 Base Path: C:\Program Files\dotnet\sdk\8.0.303\

Cargas de trabalho do .NET instaladas: Não há cargas de trabalho instaladas para exibir.

Host: Version: 8.0.7 Architecture: x64 Commit: 2aade6beb0

.NET SDKs installed: 5.0.100 [C:\Program Files\dotnet\sdk] 6.0.424 [C:\Program Files\dotnet\sdk] 8.0.303 [C:\Program Files\dotnet\sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found: arm64 [C:\Program Files\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\arm64\InstallLocation] x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables: Not set

global.json file: Not found

Learn more: https://aka.ms/dotnet/info

Download .NET: https://aka.ms/dotnet/download

VS Code version: C# Extension version: v2.39.28

OmniSharp log

Using dotnet configured on PATH Dotnet path: C:\Program Files\dotnet\dotnet.exe Activating C# standalone... Starting server at c:\Users\01518536.vscode\extensions\ms-dotnettools.csharp-2.39.29-win32-x64.roslyn\Microsoft.CodeAnalysis.LanguageServer.exe Server arguments --logLevel Trace --razorSourceGenerator c:\Users\01518536.vscode\extensions\ms-dotnettools.csharp-2.39.29-win32-x64.razor\Microsoft.CodeAnalysis.Razor.Compiler.dll --razorDesignTimePath c:\Users\01518536.vscode\extensions\ms-dotnettools.csharp-2.39.29-win32-x64.razor\Targets\Microsoft.NET.Sdk.Razor.DesignTime.targets --telemetryLevel all --extensionLogDirectory c:\Users\01518536\AppData\Roaming\Code\logs\20240806T114025\window1\exthost\ms-dotnettools.csharp [Error - 11:40:37 AM] Microsoft.CodeAnalysis.LanguageServer client: couldn't create connection to server. Error: spawn UNKNOWN at ChildProcess.spawn (node:internal/child_process:421:11) at Object.spawn (node:child_process:799:9) at W. (c:\Users\01518536.vscode\extensions\ms-dotnettools.csharp-2.39.29-win32-x64\dist\extension.js:2:1263451) at Generator.next () at s (c:\Users\01518536.vscode\extensions\ms-dotnettools.csharp-2.39.29-win32-x64\dist\extension.js:2:1253076)

Steps to reproduce

  1. Open a dotnet porject with a regular account(non admin privilege)
  2. Press F5 to start debugging the project
  3. Wait a while to building process
  4. See error on output window

Expected behavior

Start a debug session

Actual behavior

On integrated terminal the process finishes without error but application don't start, as if I only asked to build the app

Additional context

Running vscode with admin privilege the problema do not happen. I tried using only C# extension and also with C# Dev Kit, both last available version and also with versions from 6 months ago. None of those options has worked without admin privilege. I unistalled vscode and installed again, I tried installing per user and system wide and nothing made it work.

It happens even with a dummy console application just created by dotnet CLI.

JoeRobich commented 3 months ago

@alberico-lima Is it possible the SDK was installed as Admin? Do you need Admin when using the dotnet CLI?

LousyBook-01 commented 3 months ago

same bruh