Search code examples
xamarin.net-corevisual-studio-app-centervisual-studio-app-center-build

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


I've implemented .NET Core 3.0 Preview 8 into my app, but now when I try to use App Center, I get this error message:

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

Is there any way to use .NET Core 3.0 Preview 8 with App Center Build?


Solution

  • App Center Build doesn't currently support preview versions of .NET Core, but we can manually install .NET Core 3.0 Preview 8 using a post-clone script.

    Here's a walkthrough I put together on the topic: 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"