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.
This commit is contained in:
Andrew Arnott
2019-05-26 17:59:45 -06:00
parent 02708bbaea
commit 17dcdfd460
+4 -3
View File
@@ -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'