c# - Intellisense 不适用于某些脚本
问题描述
我一直在使用 vscode 来编辑我的统一脚本,但最近我无法为我的脚本使用自动完成功能,出于某种原因,我的旧项目 intellisense 似乎工作正常,但我尝试使用它的任何新项目,它只是不起作用,这里是omnisharp 输出:(是的,我已经为这个框架版本安装了目标包)。
我还尝试重新安装 vscode 并重置设置,似乎没有任何效果。
Omnisharp server running using Stdio at location 'c:\Users\Lincoln\Documents\Prototype SI' on host 7244.
The reference assemblies for framework ".NETFramework,Version=v4.5" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
Failed to load project file 'c:\Users\Lincoln\Documents\Prototype SI\Assembly-CSharp.csproj'.
c:\Users\Lincoln\Documents\Prototype SI\Assembly-CSharp.csproj C:\Users\Lincoln.vscode\extensions\ms-vscode.csharp-1.18.0.omnisharp\1.32.11\msbuild\15.0\Bin\ Microsoft.Common.CurrentVersion.targets(1126,5):错误:找不到框架“.NETFramework,Version=v4.5”的参考程序集。要解决此问题,请为此框架版本安装 SDK 或 Targeting Pack,或者将您的应用程序重新定位到已安装 SDK 或 Targeting Pack 的框架版本。请注意,程序集将从全局程序集缓存 (GAC) 中解析,并将用于代替引用程序集。因此,您的程序集可能无法正确定位于您想要的框架。
Attempted to update project that is not loaded: c:\Users\Lincoln\Documents\Prototype SI\Assembly-CSharp.csproj
Miscellaneous file: c:\Users\Lincoln\Documents\Prototype SI\Assets\Player.cs added to workspace
解决方案
尝试从 vs 代码中找到项目文件夹。单击 vs code 中的打开文件夹并导航到您的项目。
推荐阅读
- java - 了解如何使用 EL 和 JSP 表达式检索不存在的属性。与头部优先不一致
- php - 如何解决 PHP 致命错误:未捕获的错误:在 laravel 版本更新时调用未定义的方法 Illuminate\Container\Container::basePath() 错误?
- mysql - 从mysql中的两个表中嵌套选择
- python - 如何让我的机器人接收并保存我发送的文件?
- shell - 如果部分路径不存在,mkdir 也是
- javascript - 试图看看方法是如何被调用的,即。如果 $('.test') 或 $('.test').hide() ,如果第一个返回元素 如果第二个返回对象
- kubernetes - 是否可以将特定资源授予 Google Cloud 上的特定用户?
- python - 有没有办法在不搜索空格或下划线的情况下检测单词
- dns - 主机名未解析为 AD 域中 Linux 计算机的 IP 地址
- python - 语音识别 python 不适用于噪音