microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.49k stars 2.61k forks source link

MSBuild subsequent task always uses the latest version when specific msbuild version selected #13517

Closed Abrishges closed 4 years ago

Abrishges commented 4 years ago

Note

Issues in this repo are for tracking bugs, feature requests and questions for the tasks in this repo

For a list:
https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks

If you have an issue or request for the Azure Pipelines service, use developer community instead:

https://developercommunity.visualstudio.com/spaces/21/index.html )

Required Information

Entering this information will route you directly to the right team and expedite traction.

Question, Bug, or Feature?
Type: here

Enter Task Name: here

list here (V# not needed):
https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks

Environment

Agent.OS: Linux AGENT_TYPE: services-build AZP_AGENT_NAME: gsservices-build-0 AZP_POOL: GameStreaming-Services-Build Team name: xbox.streaming

Issue Description

I used task called ".NET Core" at the beginning of the tasks to install a specific version of .net core. In my tasks I specified a task version 3.1.302 so that subsequent tasks will use this version. However subsequent tasks always uses the latest version when specific msbuild version selected.

Task steps: image

.Net core installer step after execution image

Subsequent steps always uses the latest version, instead of version 3.1.302 image

Task logs

2020-09-03T01:18:21.5773056Z ##[section]Starting: Restore nuget packages
2020-09-03T01:18:21.5788944Z ==============================================================================
2020-09-03T01:18:21.5789335Z Task         : .NET Core
2020-09-03T01:18:21.5789709Z Description  : Build, test, package, or publish a dotnet application, or run a custom dotnet command
2020-09-03T01:18:21.5790233Z Version      : 2.174.0
2020-09-03T01:18:21.5790479Z Author       : Microsoft Corporation
2020-09-03T01:18:21.5790862Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/dotnet-core-cli
2020-09-03T01:18:21.5791270Z ==============================================================================
2020-09-03T01:18:22.0594383Z Info: .NET Core SDK/runtime 2.2 and 3.0 are now End of Life(EOL) and have been removed from all hosted agents. If you're using these SDK/runtimes on hosted agents, kindly upgrade to newer versions which are not EOL, or else use UseDotNet task to install the required version.
2020-09-03T01:18:22.0604555Z SYSTEMVSSCONNECTION exists true
2020-09-03T01:18:22.2022689Z SYSTEMVSSCONNECTION exists true
2020-09-03T01:18:22.4824028Z SYSTEMVSSCONNECTION exists true
2020-09-03T01:18:22.5133352Z [command]/workspace/_tool/dotnet/dotnet restore /workspace/69/s/IstioTestOne.sln --configfile /workspace/69/Nuget/tempNuGet_26723883.config --verbosity Detailed
2020-09-03T01:18:22.9219978Z Build started 09/03/2020 01:18:22.
2020-09-03T01:18:22.9234136Z      0>Process = "/workspace/_tool/dotnet/dotnet"
2020-09-03T01:18:22.9243595Z        MSBuild executable path = "/workspace/_tool/dotnet/sdk/3.1.401/MSBuild.dll"
2020-09-03T01:18:22.9246710Z        Command line arguments = "/workspace/_tool/dotnet/sdk/3.1.401/MSBuild.dll -maxcpucount -verbosity:m -nologo -target:Restore -property:RestoreConfigFile=/workspace/69/Nuget/tempNuGet_26723883.config -verbosity:Detailed /workspace/69/s/IstioTestOne.sln -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,/workspace/_tool/dotnet/sdk/3.1.401/dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,/workspace/_tool/dotnet/sdk/3.1.401/dotnet.dll"
2020-09-03T01:18:22.9248325Z        Current directory = "/workspace/69/s"
2020-09-03T01:18:22.9249232Z        MSBuild version = "16.7.0-preview-20360-03+188921e2f"
2020-09-03T01:18:23.1303545Z      1>Project "/workspace/69/s/IstioTestOne.sln" on node 1 (Restore target(s)).
2020-09-03T01:18:23.1304700Z      1>Building with tools version "Current".
2020-09-03T01:18:23.1390844Z      1>Target "ValidateSolutionConfiguration" in file "/workspace/69/s/IstioTestOne.sln.metaproj" from project "/workspace/69/s/IstioTestOne.sln" (entry point):
2020-09-03T01:18:23.1393053Z        Task "Error" skipped, due to false condition; (('$(CurrentSolutionConfigurationContents)' == '') and ('$(SkipInvalidConfigurations)' != 'true')) was evaluated as (('<SolutionConfiguration

Troubleshooting

Checkout how to troubleshoot failures and collect debug logs: https://docs.microsoft.com/en-us/vsts/build-release/actions/troubleshooting

Error logs

[Insert error from the logs here for a quick overview]

alexander-prozorov commented 4 years ago

Hello @Abrishges,

This is the intended behavior of the task. The latest .NET core SDK version is used. Look at installationPath input in the doc There are two ways to use the older version you want:

  1. Use global.json.
  2. Specify a non-default value for installationPath input. You can use $(Agent.TempDirectory) or any other temp directory.
anatolybolshakov commented 4 years ago

Hi @Abrishges is it still actual for you?

Abrishges commented 4 years ago

@anatolybolshakov @alexander-prozorov Thanks. Temp directory $(Agent.TempDirectory) works. If it is intended behavior we can close this Issue