构建失败,错误 MT2101:无法解析引用 'System.String[] System.String::Split(System.Char,System.StringSplitOptions)'

Build fail, error MT2101: Can't resolve the reference 'System.String[] System.String::Split(System.Char,System.StringSplitOptions)'

使用 Microsoft Hosted MacOS 代理在 Azure DevOps(以前称为 VSTS)上构建时失败,mac-os-10.14。有什么想法吗?

Mac-Os14 和我的 mac OS 中安装的软件的区别如下: Hos特工 Mac-Os14:

VS Mac:8.4.0 努盖特:4.7.0 Xcode最新:11.3 .NET 核心 SDK 1.0.1 1.0.4 1.1.10 1.1.11 1.1.12 1.1.13 1.1.4 1.1.5 1.1.7 1.1.8 1.1.9 2.0.0 2.0.3 2.1.100 2.1.101 2.1 .102 2.1.103 2.1.104 2.1.105 2.1.2 2.1.200 2.1.201 2.1.202 2.1.300 2.1.301 2.1.302 2.1.4 2.1.400 2.1.401 2.1.402 2.1.403 0 2.1.402 2.1.403 0 2.1.4 2.1.502 2.1.503 2.1.504 2.1.505 2.2.100 2.2.101 2.2.102 2.2.103 2.2.104 2.2.105

我的Mac:

VS Mac:8.4.1 努盖特:5.3.0 Xcode最新:11.3.1 .NET 核心开发工具包 SDK: /usr/local/share/dotnet/sdk/3.1.100/SDKs 开发工具包版本: 3.1.100 3.0.101 3.0.100 2.1.701 2.1.700 2.1.505 2.1.504 2.1.302 MSBuild SDK:/Library/Frameworks/Mono.framework/Versions/6.6.0/lib/mono/msbuild/Current/bin/Sdks

Visual StudioMac

的环境
=== Visual Studio Community 2019 for Mac ===

Version 8.4.1 (build 4)
Installation UUID: 1b63757d-df76-44cf-be32-c4667c711155
    GTK+ 2.24.23 (Raleigh theme)
    Xamarin.Mac 5.16.1.25 (issue-7441-d16-3-vsmac / 881172e73)

    Package version: 606000155

=== Mono Framework MDK ===

Runtime:
    Mono 6.6.0.155 (2019-08/296a9afdb24) (64-bit)
    Package version: 606000155

=== Roslyn (Language Service) ===

3.4.0-beta4-19562-05+ff930dec4565e2bc424ad3bf3e22ecb20542c87d

=== NuGet ===

Version: 5.3.0.6192

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/3.1.100/Sdks
SDK Versions:
    3.1.100
    3.0.101
    3.0.100
    2.1.701
    2.1.700
    2.1.505
    2.1.504
    2.1.302
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.6.0/lib/mono/msbuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
    3.1.0
    3.0.1
    3.0.0
    2.1.14
    2.1.13
    2.1.12
    2.1.11
    2.1.9
    2.1.8
    2.1.2

=== Xamarin.Profiler ===

Version: 1.6.12.26
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 11.3.1 (15715)
Build 11C504

=== Xamarin.Mac ===

Version: 6.10.0.17 (Visual Studio Community)
Hash: 5f802ef53
Branch: xcode11.3
Build date: 2020-01-07 11:53:06-0500

=== Xamarin.iOS ===

Version: 13.10.0.17 (Visual Studio Community)
Hash: 5f802ef53
Branch: xcode11.3
Build date: 2020-01-07 11:53:06-0500

=== Xamarin Designer ===

Version: 16.4.0.478
Hash: 95f0ab363
Branch: remotes/origin/d16-4
Build date: 2020-01-08 23:59:46 UTC

=== Xamarin.Android ===

Version: 10.1.3.7 (Visual Studio Community)
Commit: xamarin-android/d16-4/d66aed
Android SDK: /Users/name/Library/Developer/Xamarin/android-sdk-macosx
    Supported Android versions:
        None installed

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 28.0.2
SDK Build Tools Version: 28.0.3

Build Information: 
Mono: fd9f379
Java.Interop: xamarin/java.interop/d16-4@c4e569f
ProGuard: xamarin/proguard/master@905836d
SQLite: xamarin/sqlite/3.28.0@46204c4
Xamarin.Android Tools: xamarin/xamarin-android-tools/master@9f4ed4b

=== Microsoft Mobile OpenJDK ===

Java SDK: /Users/name/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.4.0.9
Hash: 3f7256f
Branch: remotes/origin/d16-4
Build date: 2020-01-08 19:54:56 UTC

=== Android Device Manager ===

Version: 16.4.0.28
Hash: 68e9956
Branch: remotes/origin/d16-4
Build date: 2020-01-08 19:55:18 UTC

=== Xamarin Inspector ===

Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 804010004
Git revision: 5f675128315bd5886b283aa192b334a02bc8a758
Build date: 2020-01-10 13:54:46+00
Build branch: release-8.4
Xamarin extensions: 6e5c119bf1e7b092680c1491be659f152329f74e

=== Operating System ===

Mac OS X 10.14.6
Darwin 18.7.0 Darwin Kernel Version 18.7.0
    Tue Aug 20 16:57:14 PDT 2019
    root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64

托管 Mac 上的默认 Mono 版本是 5.12,这很可能导致此问题。将 Bash 脚本任务添加到执行以下代码的管道的开头解决了我的问题。

/bin/bash -c "sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh Latest"

/bin/bash -c "echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_11.2.1.app;sudo xcode-select --switch /Applications/Xcode_11.2.1.app/Contents/Developer"

希望对您有所帮助!