-
Notifications
You must be signed in to change notification settings - Fork 57
Fix MSBuild path resolution with V2 fallback and enhanced telemetry #538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
rishabhmalikMS
wants to merge
4
commits into
main
Choose a base branch
from
users/rishabhmalikMS/SelectMSBuildFix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fixes Microsoft.IO.Redist assembly binding conflicts in VS 2022 v17.14+ by enabling feature flag MSBUILDHELPERS_ENABLE_GETMSBUILDPATHV2 to actually use Get-MSBuildPathV2. Changes: - Refactored into 3 helper functions for clean separation of concerns: * Invoke-MSBuildPathLookup: V2→V1 fallback with exception handling * Emit-MSBuildPathTelemetry: Telemetry emission accepting cached paths * Select-MSBuildPath: Orchestrator passing feature flags through version iteration - V2 function now executes FIRST when feature flag enabled (was blocked by telemetry) - Added graceful exception handling around both V1 and V2 calls - Eliminated duplicate function calls: V1/V2 invoked once, results cached and reused - Enhanced telemetry to capture ALL scenarios including failures: * true/false (both succeed, paths match/don't match) * "V1Failed_V2Success" (V2 works, V1 has assembly conflict) * "V1Success_V2Failed" (V1 works, V2 fails) * "BothFailed" (neither function returns path) - Telemetry now emits even when lookup fails (removed resolvedPath guard) - Changed Write-Error to throw for immediate task failure (respects ErrorActionPreference)
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…b.com/microsoft/azure-pipelines-tasks-common-packages into users/rishabhmalikMS/SelectMSBuildFix
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes Microsoft.IO.Redist v6.0.0.1 vs v6.1.0.0 assembly binding conflicts affecting VSBuild task in Visual Studio 2022 v17.14+. The existing feature flag
MSBUILDHELPERS_ENABLE_GETMSBUILDPATHV2was not functional due to telemetry logic calling V1 first, causing the assembly conflict before V2 could bypass it.Problem:
Get-MSBuildPath(V1) usesAssembly.LoadFrom()which loads Microsoft.IO.Redist v6.0.0.1Changes:
Work item: AB#2338296
Summarize the changes made in this PR clearly and concisely. Highlight the purpose and impact of the changes.
Package Name
Name of the updated or newly created shared npm package.
Risk Assessment (Low / Medium / High)
Low
Unit Tests Added or Updated
Additional Testing Performed
Test pipeline link with changes: https://dev.azure.com/rishabhmalikOrg/Test%20Project/Test%20Project%20Team/_build/results?buildId=2159&view=logs&j=12f1170f-54f2-53f3-20dd-22fc7dff55f9&t=2cccd56d-f2bb-5d36-e6bc-0f6d6ac6ba90&l=119
Documentation Changes Required (Yes / No)
Indicate whether related documentation needs to be updated. Provide links to the updated documentation if applicable.
Dependencies
List any dependencies introduced or updated in this PR.
Checklist