【问题标题】:How do I fix Visual Studio Treating C# Unity Scripts as Miscellaneous, and thus not autocompleting?如何修复 Visual Studio 将 C# Unity 脚本视为杂项,因此无法自动完成?
【发布时间】:2021-08-08 18:16:23
【问题描述】:

这是我在 2015 年遇到的几乎与 this 帖子相同的问题,其中一些修复问题(例如,当我在市场上找不到现代对应物时下载 Unity 2015 工具)似乎已经过时.

我的情况也很独特,因为我正在尝试从导入的 Unity 项目编辑脚本,因为我现在在一台新 PC 上,需要继续我的 Udemy 课程,以安装新的 Unity。我直接从 Udemy 课程的资源中下载了该项目,诚然,该项目是在我不习惯使用的较旧版本的 Unity 上,因此我将其升级到较新的版本 (2020.3.13f1)。

我不确定这是否是升级、导入项目的问题,还是真正的问题。我还应该提到我的 Visual Studio 版本是从 Unity Hub 中下载的,同时安装了 Unity 引擎本身,所以我不太明白为什么它甚至不会看到新创建的脚本与 Unity 相关联。

尝试打开脚本时 Unity 中的错误消息:

win32Exception:applicationname ='c:\ users \ amoll \ OnedRive \ Desktop \ Unity Projects \ 07-Placite-Garden-6Fe396CD56C6C514191C37DBC514191CF6F8 \ 07-Grading-6F2396CD56C6C5141191C37DBC1B42107CF6F8 \ Library.Ind.Visualstudio @ 2.0.11\Editor\COMIntegration\Release\COMIntegration.exe', CommandLine='"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe" "C:\Users\ amoll \ OneDrive \桌面\统一项目\ 07-毛刺,园林6fe3e396cd56c6c514191c37dbc1b42107ecf6f8 \ 07-毛刺,园林6fe3e396cd56c6c514191c37dbc1b42107ecf6f8 \ 07-毛刺,园林6fe3e396cd56c6c514191c37dbc1b42107ecf6f8.sln” “” -1' ,currentDirectory所= '',本机错误=的系统找不到指定的文件。

System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) (at :0) System.Diagnostics.Process.Start () (at :0) (wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start() Microsoft.Unity.VisualStudio.Editor.VisualStudioEditor.OpenWindowsApp(System.String 路径,System.Int32 行)(在 Library/PackageCache/com.unity.ide.visualstudio@2.0.11/Editor/VisualStudioEditor.cs:323) Microsoft.Unity.VisualStudio.Editor.VisualStudioEditor.OpenProject(System.String 路径,System.Int32 行,System.Int32 列)(在 Library/PackageCache/com.unity.ide.visualstudio@2.0.11/Editor/VisualStudioEditor.cs :224) UnityEditor.CodeEditorProjectSync.OpenProjectFileUnlessInBatchMode () (在 :0) UnityEditor.CodeEditorProjectSync.SyncAndOpenSolution () (在 :0)

【问题讨论】:

  • 确保在安装 Visual Studio 时选择了 Unity 选项

标签: c# visual-studio unity3d


【解决方案1】:

您应该做的第一件事是统一确保在首选项和外部编辑器中选择了 Visual Studio 2019。如果已经存在,那么也尝试右键单击项目中的任意位置,然后单击打开 C# 项目。我遇到了这个问题,出于某种原因,右键单击并选择打开的 C# 项目对我有用。也可以尝试在 Visual Studio 中右键单击并重建解决方案。

【讨论】:

  • 无论出于何种原因,在将 Visual Studio 作为我的外部编辑器首选项后,我现在无法使用“打开 C# 项目”打开文件每当我单击该选项时,实际上什么都没有发生。另外,如果您能解释一下,我不确定如何在视觉工作室中提出最后一条建议?右键单击后,我在任何地方都看不到该选项。
  • 确保在 Visual Studio 安装程序中已下载“使用 Unity 进行游戏开发”。从我所看到的情况来看,Visual Studio 似乎是问题所在。不团结
  • > 右键单击​​项目中的任意位置,然后单击打开 C# 项目这对我有用。 2021 年在商业软件中看到这种蹩脚的工具问题很奇怪。花了两个小时来解决它(我对 Unity 不是很熟悉,但是对于 Android 或 iOS 开发工具来说,这种愚蠢的问题似乎是不可能的)。
猜你喜欢
  • 2017-07-11
  • 1970-01-01
  • 2017-07-24
相关资源
最近更新 更多