linux - VS 代码无法在 Linux 上加载我的统一项目

标签 linux unity3d visual-studio-code

我有一个旧的 Unity 项目,我正在恢复工作。 在最近安装的 Ubuntu 18.04 上,我安装了 Unity 2018.2.2f1 和适用于 Linux 的最新版本的 VS 代码。 我按照指南进行设置,安装了 Unity 的扩展包。然后尝试使用 VS Code 打开我的 Unity 项目。

嗯,打开投诉我的项目无法正常打开。关于 OmniSharp 组件的一些信息。 我可以编辑代码,但智能感知似乎存在重大问题。这有点阻碍了我的工作流程。

现在,我是 VS Code 的新手,所以我可能错过了一些东西,但到目前为止我在谷歌上找不到任何答案。

这是完整的 Omnisharp 日志

Starting OmniSharp server at 8/12/2018, 1:14:41 AM
    Target: /home/grambo/personal_game_projects/KvaGram_short_games/KvaGram_short_games.sln

OmniSharp server started
    Path: /home/grambo/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/run
    PID: 16830

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on ubuntu 18.4 (x64)
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 1 MSBuild instance(s)
            1: StandAlone 15.0 - "/home/grambo/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/omnisharp/msbuild/15.0/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        MSBUILD_EXE_PATH environment variable set to '/home/grambo/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/omnisharp/msbuild/15.0/Bin/MSBuild.dll'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: StandAlone 15.0 - "/home/grambo/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/omnisharp/msbuild/15.0/Bin"
            MSBuildExtensionsPath = /home/grambo/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/omnisharp/msbuild
            BypassFrameworkInstallChecks = true
            CscToolPath = /home/grambo/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/omnisharp/msbuild/15.0/Bin/Roslyn
            CscToolExe = csc.exe
            MSBuildToolsPath = /home/grambo/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/omnisharp/msbuild/15.0/Bin
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in '/home/grambo/personal_game_projects/KvaGram_short_games'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Initializing in /home/grambo/personal_game_projects/KvaGram_short_games
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Auto package restore: False
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Update workspace context
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Resolving projects references
[info]: OmniSharp.MSBuild.ProjectSystem
        Detecting projects in '/home/grambo/personal_game_projects/KvaGram_short_games/KvaGram_short_games.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/home/grambo/personal_game_projects/KvaGram_short_games/Assembly-CSharp-firstpass.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/home/grambo/personal_game_projects/KvaGram_short_games/Assembly-CSharp.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/home/grambo/personal_game_projects/KvaGram_short_games/Assembly-CSharp-Editor-firstpass.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/home/grambo/personal_game_projects/KvaGram_short_games/Assembly-CSharp-Editor.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/home/grambo/personal_game_projects/KvaGram_short_games'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.Stdio.Host
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.Stdio.Host
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location '/home/grambo/personal_game_projects/KvaGram_short_games' on host 16750.
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /home/grambo/personal_game_projects/KvaGram_short_games/Assembly-CSharp-firstpass.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        The reference assemblies for framework ".NETFramework,Version=v4.7.1" 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.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file '/home/grambo/personal_game_projects/KvaGram_short_games/Assembly-CSharp-firstpass.csproj'.
/home/grambo/personal_game_projects/KvaGram_short_games/Assembly-CSharp-firstpass.csproj
/home/grambo/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/omnisharp/msbuild/15.0/Bin/Microsoft.Common.CurrentVersion.targets(1140,5): Error: The reference assemblies for framework ".NETFramework,Version=v4.7.1" 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.

我希望有人能帮我解决这个问题。

最佳答案

错误消息似乎有部分误导性。 看来我忘了安装单声道,并按照此处的安装说明进行操作:( https://www.mono-project.com/download/stable/ ),VS Code 现在似乎可以按预期加载。

关于linux - VS 代码无法在 Linux 上加载我的统一项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51804556/

相关文章:

android - 检查触摸点是否在 Unity 中的盒子碰撞器内

c# - 在纹理上调用 Resources.Load 不起作用

python - 如何在 Visual Studio Code 中格式化 python 代码?

visual-studio-code - 使用键盘命令保存为 "Retry as Sudo"

java - VSCode 是否支持 Maven 项目的 IntelliSense?

c++ - 如何在不重新打印的情况下更新终端中的打印消息

c - GDB SIGALRM,闹钟终止

Unity3D 使用四元数的相对偏移对象旋转

linux - 如何从文本文件获取Centos安装日期

css - Windows 和 Linux 中 css 定位的区别