0

I have a simple pipeline building REST API project in .net 6. When Restore task is running it's showing following information

C:\Windows\system32\chcp.com 65001
Active code page: 65001

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.

##[warning]No package sources were found in the NuGet.config file at 
F:\Builds\Agent2\45\Nuget\tempNuGet_94288.config
"C:\Program Files\dotnet\dotnet.exe" restore 
 F:\Builds\Agent2\45\s\Sample.API\Sample.API.csproj --configfile 
 F:\Builds\Agent2\45\Nuget\tempNuGet_94288.config --verbosity Detailed
 Build started 06/10/2022 14:05:43.
 0>Process = "C:\Program Files\dotnet\dotnet.exe"
   MSBuild executable path = "C:\Program Files\dotnet\sdk\6.0.302\MSBuild.dll"
   Command line arguments = "C:\Program Files\dotnet\sdk\6.0.302\MSBuild.dll -maxcpucount -verbosity:m -nologo -target:Restore -property:xyz
   MSBuild version = "17.2.0+41abc5629"
   Resolving SDK 'Microsoft.NET.Sdk.Web'...
   Resolving SDK 'Microsoft.NET.Sdk'...

When build task is running, it show following information

[command]C:\Windows\system32\chcp.com 65001
Active code page: 65001

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.

[command]"C:\Program Files\dotnet\dotnet.exe" build 
F:\Builds\Agent2\45\s\Sample.API\Sample.API.csproj "-dl:CentralLogger,\"F:\Builds\Agent2\_tasks\DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b\2.181.0\dotnet-build-helpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll\"*ForwardingLogger,\"F:\Builds\Agent2\_tasks\DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b\2.181.0\dotnet-build-helpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll\"" --configuration Release -v d
 Microsoft (R) Build Engine version 16.7.0+7fb82e5b2 for .NET
 Copyright (C) Microsoft Corporation. All rights reserved.

 Build started 06/10/2022 14:05:49.
 0>Process = "C:\Program Files\dotnet\dotnet.exe"
 MSBuild executable path = "C:\Program Files\dotnet\sdk\3.1.403\MSBuild.dll"
 Command line arguments = ""C:\Program Files\dotnet\sdk\3.1.403\MSBuild.dll" -maxcpucount -verbosity:m -restore -consoleloggerparameters:Summary -property:Configuration=Release -verbosity:d F:\Builds\Agent2\45\s\Sample.API\Sample.API.csproj "-dl:CentralLogger,\"F:\Builds\Agent2\_tasks\DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b\2.181.0\dotnet-build-helpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll\"*ForwardingLogger,\"F:\Builds\Agent2\_tasks\DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b\2.181.0\dotnet-build-helpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll\"""
 Current directory = "F:\Builds\Agent2\45\s"
 MSBuild version = "16.7.0+7fb82e5b2"
 Resolving SDK 'Microsoft.NET.Sdk.Web'...
 Resolving SDK 'Microsoft.NET.Sdk'...

The msbuild version used for restore is "17.2.0+41abc5629" & path is C:\Program Files\dotnet\sdk\6.0.302\MSBuild.dll, but Build task is using previous version MSBuild 16.7.0+7fb82e5b2 and building .net 6 project with following path C:\Program Files\dotnet\sdk\3.1.403\MSBuild.dll causing app build to fail.

Azure Devops Build pipeline is using the default .net core app task with defaults parameters. Is there reason, why pipeline behave this way. Building the project locally use same MSbuild for restore and Build, but for devOps, it doesn't.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
A.P.S
  • 1,124
  • 4
  • 17
  • 36
  • "Is there reason, why pipeline behave this way[?]" No, this is not expected behavior. There is an issue. Check the configuration of the two tasks and verify they are configured to use the same SDK/Framework – Jonathan Dodds Oct 13 '22 at 15:50

0 Answers0