如何在 App Center Build 中使用 .NET Core 3.0 Preview8

How to use .NET Core 3.0 Preview8 with App Center Build

我已经在我的应用程序中实现了 .NET Core 3.0 Preview 8,但现在当我尝试使用 App Center 时,我收到了这条错误消息:

The current .NET SDK does not support targeting .NET Core 3.0

==============================================================================
Task         : Command Line
Description  : Run a command line with arguments
Version      : 1.1.3
Author       : Microsoft Corporation
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=613735)
==============================================================================
[command]/bin/bash -c /usr/bin/find . -name '*.sln' -type f -print0 | /usr/bin/xargs -0 grep -l 'MondayPundayApp.Droid.csproj' | /usr/bin/xargs -I '{}' nuget restore '{}' -DisableParallelProcessing
MSBuild auto-detection: using msbuild version '15.0' from '/Library/Frameworks/Mono.framework/Versions/6.0.0/lib/mono/msbuild/15.0/bin'.
/Users/vsts/hostedtoolcache/dotnet/sdk/2.2.300/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.0.  Either target .NET Core 2.2 or lower, or use a version of the .NET SDK that supports .NET Core 3.0. [/Users/vsts/agent/2.155.1/work/1/s/Src/MondayPundayApp.UnitTests/MondayPundayApp.UnitTests.csproj]

##[error]/bin/bash failed with return code: 1
##[error]/bin/bash failed with error: /bin/bash failed with return code: 1

有什么方法可以将 .NET Core 3.0 Preview 8 与 App Center Build 结合使用吗?

App Center Build 目前不支持 .NET Core 预览版,但我们可以使用 post-clone script.

手动安装 .NET Core 3.0 Preview 8

这是我针对该主题整理的演练: https://www.codetraveler.io/2019/08/23/using-preview-versions-of-net-core-with-app-center-build/

wget https://dot.net/v1/dotnet-install.sh
chmod +x dotnet-install.sh
./dotnet-install.sh --version "3.0.100-preview8-013656" --install-dir "$AGENT_TOOLSDIRECTORY/dotnet"