[英]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.