Skip to content

Use ToLowerInvariant().Contains(...) for .NET Framework - #31353

Merged
mattleibow merged 1 commit into
net10.0from
fixmsbuild
Aug 26, 2025
Merged

Use ToLowerInvariant().Contains(...) for .NET Framework#31353
mattleibow merged 1 commit into
net10.0from
fixmsbuild

Conversation

@StephaneDelcroix

@StephaneDelcroix StephaneDelcroix commented Aug 26, 2025

Copy link
Copy Markdown
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description of Change

Replaces Contains(..., StringComparison.OrdinalIgnoreCase) with ToLowerInvariant().Contains(...) for case-insensitive string matching because .NET Standard 2.0 and/or .NET Framework 4.x does not have the nice new overloads.

Copilot AI review requested due to automatic review settings August 26, 2025 14:45
@StephaneDelcroix
StephaneDelcroix requested a review from a team as a code owner August 26, 2025 14:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an MSBuild error by replacing deprecated StringComparison enum usage in MSBuild target files with a more compatible string comparison approach. The change ensures the XAML inflator type checking works correctly across different MSBuild versions.

  • Replaces StringComparison.OrdinalIgnoreCase with ToLowerInvariant().Contains() for case-insensitive string matching
  • Updates three conditional statements that categorize MauiXaml items by inflator type
  • Maintains the same logical behavior while using MSBuild-compatible string operations

@dalexsoto

Copy link
Copy Markdown
Member

@StephaneDelcroix / @mattleibow can you backport this to this branch as well please? release/10.0.1xx-rc1

@jfversluis

Copy link
Copy Markdown
Member

/backport to release/10.0.1xx-rc1

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/10.0.1xx-rc1: https://github.com/dotnet/maui/actions/runs/17241840407

@mattleibow mattleibow changed the title fix msbuild error Use ToLowerInvariant().Contains(...) for .NET Framework Aug 26, 2025
@mattleibow
mattleibow merged commit 5ee9eb6 into net10.0 Aug 26, 2025
139 of 148 checks passed
@mattleibow
mattleibow deleted the fixmsbuild branch August 26, 2025 16:56
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants