我發現了很多關于此的問題,但沒有幫助我。我正在嘗試撰寫 c# 代碼,而omnisharp 自動完成不起作用,我從 Omnisharp 日志中得到了這個:
OmniSharp server started.
Path: c:\Users\GeorgV.216\.vscode\extensions\ms-dotnettools.csharp-1.24.1\.omnisharp\1.38.3-beta.31\OmniSharp.exe
PID: 11536
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on Windows 6.2.9200.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
[info]: OmniSharp.Services.DotNetCliService
Using the 'dotnet' on the PATH.
[info]: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 0 MSBuild instance(s)
Could not locate MSBuild instance to register with OmniSharp.
什么是可能的解決方案?
uj5u.com熱心網友回復:
對我有用的解決方案是將 setting.json 檔案中的“omnisharp.path”:從“latest”更改為“”,并洗掉 C:\Users{username}.vscode 中的 1.38.3-beta.31 檔案夾\extensions\ms-dotnettools.csharp-1.24.1.omnisharp
uj5u.com熱心網友回復:
突然也遇到了這個問題,將 "omnisharp.useModernNet": true 添加到 settings.json 為我修復了它。
uj5u.com熱心網友回復:
現在為我作業。也許原因是(來自omnisharp github):“計劃洗掉包含的Mono和MSBuild工具
將來,OmniSharp 的 .NET Framework 版本將不會隨 Mono 或 MSBuild 工具一起提供(請參閱公告 omnisharp-roslyn#2339)。為確保 C# 擴展仍然可用于 .NET SDK 專案,我們將把 omnisharp.useModernNet 的默認值更改為 true。”
但是“omnisharp.useModernNet to true”不適用于 Unity 3d。
所以。
我從 ubuntu 卸載所有 dotnet。卸載單聲道。使用以下方法重新安裝 dotnet:https ://docs.microsoft.com/es-es/dotnet/core/install/linux-ubuntu#2110- 使用突觸重新安裝 mono-complete。在 VS 設定中,使用全域單聲道將omnisharp 設定為“始終”。現在它對我有用。
uj5u.com熱心網友回復:
對我有用的解決方案:
管理設定在此處輸入代碼中搜索
"omnisharp path"編輯settings.json> 將“最新”替換為“”
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/449969.html
