vscode-csharp
vscode-csharp copied to clipboard
any solution, red omnisharp flame icon in status bar ?
Starting OmniSharp server at 5/28/2022, 15:39:48 Target: c:\Users\User\burung\burung.sln
OmniSharp server started with .NET 6.0.300 . Path: c:\Users\User.vscode\extensions\ms-dotnettools.csharp-1.25.0-win32-x64.omnisharp\1.39.0-net6.0\OmniSharp.dll PID: 9172
Unhandled exception. System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (0x8007000B) [ERROR] Error: OmniSharp server load timed out. Use the 'omnisharp.projectLoadTimeout' setting to override the default delay (one minute).
@akshita31
@dwicahyo1512 It appears you have the x86 SDK folder (C:\Program Files (x86)\dotnet
) before the x64 SDK folder (C:\Program Files\dotnet
) in your environment PATH. To fix this issue, update your System Environment PATH by removing the x86 folder.
I had this issue in Mac M1 Pro Monterrey and this was my solution (my original comment)
I had my CLI pointing to x64 versions so I downloaded the arm64 version but CLI did not even displayed it. So I needed to delete my symlink (it was pointing to x64 versions)
$ sudo rm /usr/local/bin/dotnet
and then I needed to create it in the right way:$ sudo ln -s /usr/local/share/dotnet /usr/local/bin/
I had the same problem in Mac M1 and I fixed it by changing the path in .zshrc
from
export PATH="/usr/local/share/dotnet/x64:$PATH"
to
export PATH="/usr/local/share/dotnet:$PATH"
Having the same issue with the exact same error message on Windows. PATH seems to be correct:
where dotnet
C:\Program Files\dotnet\dotnet.exe
I also uninstalled all of my installed .NET SDKs, then just installed the latest one (that comes with the latest Visual Studio), still no luck
@dennis-yemelyanov can you share you OmniSharp log from the vscode output pane as well as the output of dotnet --info
?
Having the same issue with the exact same error message on Windows. PATH seems to be correct:
where dotnet C:\Program Files\dotnet\dotnet.exe
I also uninstalled all of my installed .NET SDKs, then just installed the latest one (that comes with the latest Visual Studio), still no luck
Looks like exact same problem here on windows 10 (Linux is OK)
And I downloaded the "right" Omnisharp version directly, and the files are the same
C:\Users\davie>fc c:\Users\davie.vscode\extensions\ms-dotnettools.csharp-1.25.0-win32-x64.omnisharp\1.39.0-net6.0\OmniSharp.dll C:\Users\davie\Downloads\omnisharp-win-x64-net6.0\OmniSharp.dll Comparing files C:\USERS\DAVIE.VSCODE\EXTENSIONS\MS-DOTNETTOOLS.CSHARP-1.25.0-WIN32-X64.OMNISHARP\1.39.0-NET6.0\OmniSharp.dll and C:\USERS\DAVIE\DOWNLOADS\OMNISHARP-WIN-X64-NET6.0\OMNISHARP.DLL FC: no differences encountered
>where dotnet C:\Program Files (x86)\dotnet\dotnet.exe
>dotnet --info .NET SDK (reflecting any global.json): Version: 6.0.301 Commit: 43f9b18481
Runtime Environment: OS Name: Windows OS Version: 10.0.19042 OS Platform: Windows RID: win10-x86 Base Path: C:\Program Files (x86)\dotnet\sdk\6.0.301\
Host (useful for support): Version: 6.0.6 Commit: 7cca709db2
.NET SDKs installed: 6.0.301 [C:\Program Files (x86)\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.App 6.0.6 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.6 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 6.0.6 [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App]
C# extension info: v1.25.0
Error message (user info removed): Starting OmniSharp server at 09/07/2022, 12:41:53 Target: c:\Users<XXXXXXXX> OmniSharp server started with .NET 6.0.301 Path: c:\Users<XXXXX>.vscode\extensions\ms-dotnettools.csharp-1.25.0-win32-x64.omnisharp\1.39.0-net6.0\OmniSharp.dll PID: 12848
Unhandled exception. System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (0x8007000B)
OS Info >ver
Microsoft Windows [Version 10.0.19042.1706]
****path ****
echo %PATH% C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.13.11431.0_x64__8wekyb3d8bbwe;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files (x86)\dotnet;C:\Program Files\Microsoft VS Code\bin;C:\Users\davie\AppData\Local\Microsoft\WindowsApps;C:\Users\davie.dotnet\tools;
@Jonjump did you try removing C:\Program Files (x86)\dotnet
from the PATH?
same error with 1.25.2-win32-ia32
@Jonjump did you try removing
C:\Program Files (x86)\dotnet
from the PATH?
Rellay?
Can't the SDK x86 and x64 be installed at the same time?