dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.87k stars 675 forks source link

Keep getting: [ERROR] Error: spawn cmd ENOENT despite updating system path #3908

Closed QuecisJoshua closed 14 hours ago

QuecisJoshua commented 4 years ago

Issue Description

keep running into this error after researching and finding a post about adding a PATH (C:\Windows\System32) to my environmental variable

OmniSharp log

Starting OmniSharp server at 7/11/2020, 2:48:47 PM Target: c:\Users\Q\Documents\Myproject\Project.sln

[ERROR] Error: spawn cmd ENOENT

C# log

Getting latest OmniSharp version information Downloading package 'Latest OmniSharp Version Information' (1 KB).................... Done

Environment information

VSCode version: 1.47.0 C# Extension: 1.22.1

Dotnet Information .NET Core SDK (reflecting any global.json): Version: 3.1.301 Commit: 7feb845744 Runtime Environment: OS Name: Windows OS Version: 10.0.18362 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\3.1.301\ Host (useful for support): Version: 3.1.5 Commit: 65cd789777 .NET Core SDKs installed: 3.1.301 [C:\Program Files\dotnet\sdk] .NET Core runtimes installed: Microsoft.AspNetCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download
Visual Studio Code Extensions |Extension|Author|Version| |---|---|---| |csharp|ms-dotnettools|1.22.1|;
cartermp commented 4 years ago

@QuecisJoshua Does this still reproduce for you? Generally we wouldn't recommending changing your PATH but that should be unrelated. Are there any logs that could be shared?

HungryJakeGames commented 3 years ago

Might be related.

Every time I start my computer I run into the [ERROR] Error: spawn cmd ENOENT issue. C:\Windows\System32 is already in my Path. The strange part is that if I open the 'Edit Environment Variables' dialog, select 'C:\Windows\System32' and then close the popup (without changing anything) it fixes the issue. I can now open VS Code, and the OmniSharp works perfectly.

Windows is not my primary OS, so I apologize if I'm doing something obviously stupid.

Environment information:

VSCode version: 1.57.1 C# Extension: 1.23.12

.NET Core SDKs installed:

3.1.403 3.1.410 5.0.200 5.0.301

blup
JoeRobich commented 14 hours ago

Closing due to lack of activity.