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

时间:2019-08-23 17:35:19

标签: xamarin .net-core visual-studio-app-center visual-studio-app-center-build

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

  

当前.NET SDK不支持定位.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

是否可以通过App Center Build使用.NET Core 3.0 Preview 8?

1 个答案:

答案 0 :(得分:1)

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"