microsoft / azure-pipelines-tasks

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

[BUG]: Version 2.245.1 Produces warning #20408

Open linus66 opened 6 days ago

linus66 commented 6 days ago

New issue checklist

Task name

DotNetCoreCLI

Task version

2.245.1

Issue Description

DotNetCoreCLI@2 produces this warning

[warning]Resource file has already set to: D:\a_tasks\DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b\2.245.1\node_modules\azure-pipelines-tasks-packaging-common\module.json

Which make the BuildQualityChecks@9 fail Not present in version 2.242.1

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Windows image tested

Relevant log output

Starting: DotNet publish ....
==============================================================================
Task         : .NET Core
Description  : Build, test, package, or publish a dotnet application, or run a custom dotnet command
Version      : 2.245.1
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/dotnet-core-cli
==============================================================================
##[warning]Resource file has already set to: D:\a\_tasks\DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b\2.245.1\node_modules\azure-pipelines-tasks-packaging-common\module.json
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.
C:\hostedtoolcache\windows\dotnet\dotnet.exe publish 

Info: Azure Pipelines hosted agents have been updated and now contain .Net 5.x SDK/Runtime along with the older .Net Core version which are currently lts. Unless you have locked down a SDK version for your project(s), 5.x SDK might be picked up which might have breaking behavior as compared to previous versions. You can learn more about the breaking changes here: https://docs.microsoft.com/en-us/dotnet/core/tools/ and https://docs.microsoft.com/en-us/dotnet/core/compatibility/ . To learn about more such changes and troubleshoot, refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting
Starting: DotNet publish ...
==============================================================================
Task         : .NET Core
Description  : Build, test, package, or publish a dotnet application, or run a custom dotnet command
Version      : 2.245.1
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/dotnet-core-cli
==============================================================================
##[warning]Resource file has already set to: D:\a\_tasks\DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b\2.245.1\node_modules\azure-pipelines-tasks-packaging-common\module.json
C:\Windows\system32\chcp.com 65001
Active code page: 65001

Info: Azure Pipelines hosted agents have been updated and now contain .Net 5.x SDK/Runtime along with the older .Net Core version which are currently lts. Unless you have locked down a SDK version for your project(s), 5.x SDK might be picked up which might have breaking behavior as compared to previous versions. You can learn more about the breaking changes here: https://docs.microsoft.com/en-us/dotnet/core/tools/ and https://docs.microsoft.com/en-us/dotnet/core/compatibility/ . To learn about more such changes and troubleshoot, refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting
Finishing: DotNet publish ....

Full task logs with system.debug enabled

 [REPLACE THIS WITH YOUR INFORMATION] 

Repro steps

No response

DmitriiBobreshev commented 6 days ago

Hi @linus66, thank you for the feedback, we will take a look

luislhg commented 6 days ago

Getting the same here. Every dotnet task in a pipeline is throwing this warning now... each pipeline ends up with dozens of warnings... Please let me know if you need more info (aside from what's already in the original post). Thanks

abatishchev commented 6 days ago

+1. It's a novelty in version 2.245.1 which wasn't in version 2.242.1

ADO account: msazure/One

oatsoda commented 5 days ago

This is good fun with a Build Quality Checks task checking that Warnings haven't increased!

Gobikannan commented 5 days ago

Same here.. plenty of warnings and also sonar is showing more warnings without any details about it.

For now, i m running as below which seems fine.

- task: DotNetCoreCLI@2.242.1

abatishchev commented 5 days ago

This is good fun with a Build Quality Checks task checking that Warnings haven't increased!

Exactly what I'm dealing with right now.

  • task: DotNetCoreCLI@2.242.1

I think it's a very good workaround for now. Looking forward to something permanent.

abatishchev commented 5 days ago

Thanks to @ReneSchumacher, here's how to temporarily ignore the warnings in the quality check task:

- task: BuildQualityChecks@9
  displayName: 'Check build quality'
  inputs:
    addAttachment: false
    checkWarnings: true
    warningThreshold: 0
    warningExclusions: |
      /\[warning\]Resource file has already set to/i
lobbo232 commented 16 hours ago

After spending a chunk of time implementing this on all our pipelines, the workaround works for us too.

I think this bug needs a little more urgency as it is blocking anybody using build quality checks. Is it worth considering rolling it back perhaps?

stephajn commented 7 hours ago

By any chance, has this newer version of the task introduced some kind of bug with the memory usage? Doesn't matter if I use windows-latest or ubuntu-latest. All of my builds are out of the blue getting warnings about memory usage spiking to 95% and higher without us having changed anything in our build.