[英]How do I to fix IntelliSense in VSCode not working and OmniSharp error messages when loading unity C# scripts?
[英]Intellisense not working in VSCode - OmniSharp Error
Intellisense 已停止為我工作,每當我運行 VSCode 時,OmniSharp 日志中都會出現此錯誤。
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/Users/leogaunt/Documents/Programming/Unity/Cube Stack/Assembly-CSharp.csproj'.
/Users/leogaunt/Documents/Programming/Unity/Cube Stack/Assembly-CSharp.csproj
/Users/leogaunt/.vscode/extensions/ms-dotnettools.csharp-1.23.1/.omnisharp/1.37.0/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1178,5): Error: The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: /Users/leogaunt/Documents/Programming/Unity/Cube Stack/Assembly-CSharp.csproj
我已經嘗試重新安裝插件,並重新安裝 VSCode,但它沒有奏效。
我知道我安裝了 .NET Core,因為我是 Mac 用戶,我知道這一點是因為當我在終端中鍵入dotnet --version
時,它會輸出:
3.1.401
我在 Unity 中編程,正在為 iOS 創建游戲。
在 C# 擴展配置中,將 mono 路徑更改為始終。
從 git 存儲庫獲取 Unity 后,我遇到了同樣的問題。 對我來說,它可以在 Unity 中重置 .Net 版本。 編輯 -> 項目設置 -> Api 兼容級別
來回切換,重新啟動VSCode。 .csproj 文件將歸檔所有丟失的 dll。
相信我,它會起作用,嘗試了一切,然后來到這個
我通過卸載所有 SDK 並安裝較舊的4.7.1 解決了這個問題,然后一切都立即運行。
該錯誤表明 OmniSharp 正在尋找Version=v4.7.1 。 您可能想要安裝它的最新版本。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.