dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.86k stars 672 forks source link

[fail] OmniSharp server start fail (Win10) #3302

Closed maozi-bsz closed 5 years ago

maozi-bsz commented 5 years ago

Run vscode OmniSharp log some fail

[fail]: OmniSharp.Services.AssemblyLoader
        Failed to load assembly from path: C:\Users\linzhiyu\.vscode\extensions\ms-vscode.csharp-1.21.3\.omnisharp\1.34.3\.msbuild\Current\Bin\Microsoft.Build.Utilities.Core.dll
System.IO.FileLoadException: 未能加载文件或程序集“file:///C:\Users\xxx\.vscode\extensions\ms-vscode.csharp-1.21.3\.omnisharp\1.34.3\.msbuild\Current\Bin\Microsoft.Build.Utilities.Core.dll”或它的某一个依赖项。不支持操作。 (异常来自 HRESULT:0x80131515)
文件名:“file:///C:\Users\xxx\.vscode\extensions\ms-vscode.csharp-1.21.3\.omnisharp\1.34.3\.msbuild\Current\Bin\Microsoft.Build.Utilities.Core.dll”
filipw commented 5 years ago

Try updating to 1.21.4

maozi-bsz commented 5 years ago

Try updating to 1.21.4

That is not work too.

System info:

Name Version
System Windows10 Professional
dotNetCore 3.0.100
dotNetFramework 4.8

Description

Try to run Omnisharp.exe in cmd and it show found 1 Standalone MsBuild. Then it print some error:

{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.Discovery.MSBuildLocator","Message":"Located 1 MSBuild instance(s)
            1: StandAlone 16.0 - \"C:\\Users\\xxx\\.vscode\\extensions\\ms-vscode.csharp-1.21.4\\.omnisharp\\1.34.4\\.msbuild\\Current\\Bin\""},"Seq":3,"Type":"event"}

Failed to load assembly from path: C:\\Users\\xxx\\.vscode\\extensions\\ms-vscode.csharp-1.21.4\\.omnisharp\\1.34.4\\.msbuild\\Current\\Bin\\Microsoft.Build.Utilities.Core.dll\r\nSystem.IO.FileLoadException: 未能加载文件或程序集(Can not load file or assembly)“file:///C:\\Users\\xxx\\.vscode\\extensions\\ms-vscode.csharp-1.21.4\\.omnisharp\\1.34.4\\.msbuild\\Current\\Bin\\Microsoft.Build.Utilities.Core.dll”或它的某一个依赖项。不支持操作。(or one of the dependencies do not support operate.)

I do not have VS. So the MSBuild Locator for VS could not work.I just find MsBuild in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe.How could I config the path to OmniSharp.

maozi-bsz commented 5 years ago

I have installed Visual Studio,and Omnisharp server finilly start up.So we can not use Omnisharp server without Visual Studio?