Skip to content

Fix XA4211 warning message to use TargetPlatformVersion for .NET 6+ #10197

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

Merged
merged 4 commits into from
Jun 13, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 13, 2025

Customers reported that the XA4211 warning message contains outdated property references and blank values for .NET 6+ projects:

AndroidManifest.xml: Warning XA4211 : AndroidManifest.xml //uses-sdk/@android:targetSdkVersion '34' is less than $(TargetFrameworkVersion) ''. Using API-35 for ACW compilation.

The warning was written during the Xamarin.Android timeframe and needs updating for .NET 6+:

  • Property name: $(TargetFrameworkVersion) should be $(TargetPlatformVersion) for .NET 6+
  • Blank values: The empty '' appears because the message references the wrong property

Changes

Updated the XA4211 message in Resources.resx:

  • Changed message text from $(TargetFrameworkVersion) to $(TargetPlatformVersion)
  • Updated comment documentation to reference the correct property
  • Updated parameter description to reflect "target platform version number"

This occurs when developers explicitly set a lower target SDK version in their AndroidManifest.xml:

<uses-sdk android:targetSdkVersion="34" />

The warning is reasonable to show, but the message text should be accurate for modern .NET Android projects.

Fixes #10196.


💡 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.

@Copilot Copilot AI changed the title [WIP] Fix XA4211 warning message Fix XA4211 warning message to use TargetPlatformVersion for .NET 6+ Jun 13, 2025
@Copilot Copilot AI requested a review from jonathanpeppers June 13, 2025 15:40
Copilot finished work on behalf of jonathanpeppers June 13, 2025 15:40
Copy link
Contributor Author

Copilot AI commented Jun 13, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • ci.dot.net
    • Triggering command: curl -s --fail REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of jonathanpeppers June 13, 2025 16:27
@jonathanpeppers jonathanpeppers marked this pull request as ready for review June 13, 2025 16:30
@jonathanpeppers jonathanpeppers enabled auto-merge (squash) June 13, 2025 16:33
@jonathanpeppers jonathanpeppers merged commit 100d8c5 into main Jun 13, 2025
59 checks passed
@jonathanpeppers jonathanpeppers deleted the copilot/fix-10196 branch June 13, 2025 17:33
@github-actions github-actions bot locked and limited conversation to collaborators Jul 14, 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.

Fix XA4211 warning message
2 participants