首页 > 解决方案 > 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

标签: c#unity3d

解决方案


尝试从 vs 代码中找到项目文件夹。单击 vs code 中的打开文件夹并导航到您的项目。


推荐阅读