From 17dcdfd4603bec6d647f31252691d87680e80c2f Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Sun, 26 May 2019 17:59:45 -0600 Subject: [PATCH] Prefer modern UseDotNet task over obsolete DotNetCoreInstaller The `UseDotNet` task is newer and follows best practices from the dotnet SDK team better than the older `DotNetCoreInstaller` task. One significant difference between the two is that `UseDotNet` sets `DOTNET_MULTILEVEL_LOOKUP=0`, such that once you use this task once, you have to manually install *all* SDK/runtime versions that your pipeline requires. This task *may* be used more than once in order to accomplish this. This is actually a *good* thing, because it means your pipeline is more fully self-describing, and less dependent on whatever versions the agents happen to have installed at the time. --- build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build.yml b/build.yml index b8f2d70..81e2f1e 100644 --- a/build.yml +++ b/build.yml @@ -1,7 +1,8 @@ steps: -- task: DotNetCoreInstaller@0 +- task: UseDotNet@2 inputs: - version: '2.2.300' - displayName: 'Install .NET Core SDK' + version: 2.2.300 + displayName: Install .NET Core SDK + - script: dotnet msbuild build.proj /p:Configuration=$(buildConfiguration) displayName: 'Run Build'