我试图在Linux(Ubuntu18.10)下用VSCode打开一个Unity3D项目.omnisharp扩展没有加载该项目,称未找到程序集.

这可能看起来很愚蠢,但我真的不习惯.Net,我已经被这个错误困扰了好几天了.

所以欢迎任何帮助!:)

统一版本:2018.3.1f1

Logs :

dotnet -- info

.NET Core SDK (reflecting any global.json):
 Version:   2.2.103
 Commit:    8edbc2570a

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  18.10
 OS Platform: Linux
 RID:         ubuntu.18.10-x64
 Base Path:   /usr/share/dotnet/sdk/2.2.103/

Host (useful for support):
  Version: 2.2.1
  Commit:  878dd11e62

.NET Core SDKs installed:
  2.2.103 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.2.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.2.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.2.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

mono --version

Mono JIT compiler version 4.6.2 (Debian 4.6.2.7+dfsg-1ubuntu1)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       altstack
    Notifications: epoll
    Architecture:  amd64
    Disabled:      none
    Misc:          softdebug 
    LLVM:          supported, not enabled.
    GC:            sgen

The full log error :

    Starting OmniSharp server at 1/26/2019, 7:13:55 PM
    Target: /home/eyap/Projects/Unity/TestProject/TestProject.sln

OmniSharp server started.
    Path: /home/eyap/.vscode/extensions/ms-vscode.csharp-1.17.1/.omnisharp/1.32.8/run
    PID: 30136

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on ubuntu 18.10 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 1 MSBuild instance(s)
            1: StandAlone 15.0 - "/home/eyap/.vscode/extensions/ms-vscode.csharp-1.17.1/.omnisharp/1.32.8/omnisharp/msbuild/15.0/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        MSBUILD_EXE_PATH environment variable set to '/home/eyap/.vscode/extensions/ms-vscode.csharp-1.17.1/.omnisharp/1.32.8/omnisharp/msbuild/15.0/Bin/MSBuild.dll'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: StandAlone 15.0 - "/home/eyap/.vscode/extensions/ms-vscode.csharp-1.17.1/.omnisharp/1.32.8/omnisharp/msbuild/15.0/Bin"
            MSBuildExtensionsPath = /home/eyap/.vscode/extensions/ms-vscode.csharp-1.17.1/.omnisharp/1.32.8/omnisharp/msbuild
            BypassFrameworkInstallChecks = true
            CscToolPath = /home/eyap/.vscode/extensions/ms-vscode.csharp-1.17.1/.omnisharp/1.32.8/omnisharp/msbuild/15.0/Bin/Roslyn
            CscToolExe = csc.exe
            MSBuildToolsPath = /home/eyap/.vscode/extensions/ms-vscode.csharp-1.17.1/.omnisharp/1.32.8/omnisharp/msbuild/15.0/Bin
            TargetFrameworkRootPath = /usr/lib/mono/xbuild-frameworks
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in '/home/eyap/Projects/Unity/TestProject'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.WorkspaceInitializer
        Project system 'OmniSharp.DotNet.DotNetProjectSystem' is disabled in the configuration.
[info]: OmniSharp.MSBuild.ProjectSystem
        Detecting projects in '/home/eyap/Projects/Unity/TestProject/TestProject.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/home/eyap/Projects/Unity/TestProject/Assembly-CSharp.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/home/eyap/Projects/Unity/TestProject'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location '/home/eyap/Projects/Unity/TestProject' on host 30056.
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /home/eyap/Projects/Unity/TestProject/Assembly-CSharp.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/eyap/Projects/Unity/TestProject/Assembly-CSharp.csproj'.
/home/eyap/Projects/Unity/TestProject/Assembly-CSharp.csproj
/home/eyap/.vscode/extensions/ms-vscode.csharp-1.17.1/.omnisharp/1.32.8/omnisharp/msbuild/15.0/Bin/Microsoft.Common.CurrentVersion.targets(1195,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.

[fail]: OmniSharp.MSBuild.ProjectManager
        Attemped to update project that is not loaded: /home/eyap/Projects/Unity/TestProject/Assembly-CSharp.csproj

推荐答案

我也有同样的问题,但在OSX上.安装最新版本的Mono清除了缺失的功能.NETV4.7.1框架参考.

我安装了Mono V5.18.0比https://www.mono-project.com/download/stable

更新:请参阅下面关于全球omnisharp设置的 comments

Linux相关问答推荐

如何注释掉SLURM中的延迟调度命令?

PERF显示不应该执行指令的内核的用户空间周期

没有发现运行时依赖关系,但它在S的运行时路径中有吗?

使用awk命令将以:分隔的两个文件合并的方法

如何修复 script(1) 实用程序输出的换行符?

我可以在不调用 shell 的情况下使用 popen() 吗?在 C++ 中

如何拆分和计算 Bash 中单词的出现次数?

使用 sed 从文本文件中删除特定字符串

如何使用awk或其他方法提取双引号中的子字符串?

有没有办法定义自定义隐式 GNU Make 规则?

在 SLURM 作业(job)脚本中设置和传递字符串变量

PHP factor 30 从 Linux 到 Windows 的性能差异

Linux 应用程序分析

仅在不存在时添加换行符

如何删除 Mercurial 存储库

比较两个图像的 python/linux 方式

如何运行我所有的 PHPUnit 测试?

如何使用终端打开-虚线文件名?

Linux 守护进程

如何计算一个单词在目录的所有文件中出现的次数?