Skip to content
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

removing the dependency on IO.Redist from MSBuild GetPathToBuildToolsFile #11270

Merged
merged 4 commits into from
Jan 14, 2025

Conversation

SimaTian
Copy link
Member

@SimaTian SimaTian commented Jan 13, 2025

Fixes https://developercommunity.visualstudio.com/t/Unable-to-locate-MSBuild-path-with-Lates/10824132

Work item (Internal use): https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2343019

Related to:
microsoft/azure-pipelines-tasks#20734

Summary

The Get-MsBuildPath function used by the Azure Devops MSBuild@1 task uses reflection to load a MSBuild function and then call it.
MSBuild recently introduced (#9223) a dependency on Microsoft.IO.Redist in this codepath (it was used elsewhere in the assembly before). Microsoft.IO.Redist depends on System.Memory, which is in the MSBuild folder but at a higher version, so fails to load without binding redirects.

This will cause the AzDO function to use a fallback location method that will load a very-old MSBuild (from .NET Framework 4) and the whole pipeline will most likely fail.

Customer Impact

Failure of Azure DevOps pipelines that use MSBuild or VSBuild AzDO tasks VS 17.13.

Regression?

Yes, from 17.12 and 17.13-preview.1, caused by #9223.

Testing

Manual testing with local versions of the AzDO script. VS experimental insertion for main branch has succeeded.

Risk

low: switching to directly use System.IO methods instead of wrappers that may use Microsoft.IO.Redist

…aded by powershell. This clash happens due to an ADO script function Get-MsBuildPath
@SimaTian SimaTian requested a review from a team as a code owner January 13, 2025 16:24
@rainersigwald rainersigwald merged commit bfea91c into vs17.13 Jan 14, 2025
10 checks passed
@rainersigwald rainersigwald deleted the AZDO-assembly-collision-vs17.13-backport branch January 14, 2025 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants