首页 > 解决方案 > VS 代码无法在 Linux 上加载我的统一项目

问题描述

我有一个旧的 Unity 项目正在恢复工作。在最近安装的 Ubuntu 18.04 上,我安装了 Unity 2018.2.2f1 和适用于 Linux 的最新版本的 VS code。我按照指南进行了设置,安装了 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.

我希望有人可以帮助我。

标签: linuxunity3dvisual-studio-code

解决方案


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


推荐阅读