Use Azure DevOps logging command format for version bump check error with file navigation - #12585
#12585Use Azure DevOps logging command format for version bump check error with file navigation#12585YuliiaKovalova merged 4 commits intomaindotnet/msbuild:mainfrom copilot/fix-a85992cb-3169-467e-9509-1ab08adbd7e9dotnet/msbuild:copilot/fix-a85992cb-3169-467e-9509-1ab08adbd7e9Copy head branch name to clipboard
Conversation
|
Hello @@copilot, I noticed that you’re changing an .swr file or any file under src/Package/MSBuild.VSSetup.. Please make sure to validate this change by an experimental VS insertion. This is accomplished by pushing to an exp/* branch, which requires write permissions to this repo. |
Co-authored-by: rainersigwald <3347530+rainersigwald@users.noreply.github.com>
throwing here, use the AzDO format commands (https://learn.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands?view=azure-devops&tabs=bash#formatting-commands) to report a...There was a problem hiding this comment.
@copilot Can you also report the file and line number of the Versions.props file that should change?
|
@copilot Can you also report the file and line number of the Versions.props file that should change? |
Co-authored-by: rainersigwald <3347530+rainersigwald@users.noreply.github.com>
Added in commit 3b385bf. The error message now includes |
There was a problem hiding this comment.
Pull Request Overview
This PR updates the Azure DevOps pipeline error handling for the version bump check to use a structured logging command instead of throwing a PowerShell exception, improving discoverability and navigation in the pipeline UI.
- Replaces throw with an Azure DevOps logging command (##vso[task.logissue ...])
- Adds file path and line number metadata for clickable navigation
- Explicitly exits with non-zero status using exit 1
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |

Summary
Fixes the error reporting in
.vsts-dotnet-ci.ymlline 48 to use proper Azure DevOps logging command format instead ofthrow, making errors easier to find and diagnose in the Azure DevOps pipeline UI. The error message now includes file path and line number information for direct navigation.Problem
When the version bump check failed on release branches (vs* branches), the error was thrown as a PowerShell exception, which made it harder to locate and understand in the Azure DevOps pipeline logs. The error message was embedded in a
throwstatement, which doesn't utilize Azure DevOps' formatting capabilities or provide navigation to the specific file location that needs to be changed.Solution
Replace the
throwstatement with:Write-Hostto emit the proper Azure DevOps logging command:##vso[task.logissue type=error]sourcepathandlinenumberproperties to enable direct navigation to the file locationexit 1to explicitly fail the step with a non-zero exit codeBefore:
After:
Benefits
eng/Versions.propswhere theVersionPrefixneeds to be updatedTesting
Validated that:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.