Skip to content

Remove XA1024 warning for .config files#11263

Merged
jonathanpeppers merged 4 commits into
mainfrom
copilot/remove-xa1024-warning
May 4, 2026
Merged

Remove XA1024 warning for .config files#11263
jonathanpeppers merged 4 commits into
mainfrom
copilot/remove-xa1024-warning

Conversation

Copilot AI commented May 1, 2026

Copy link
Copy Markdown
Contributor

XA1024 fires for any file with a .config extension, producing false positives for files like nuget.config. The warning is also redundant — .config files are already removed from publish output by the <ResolvedFileToPublish Remove="..."/> above it. The .NET 6 transition period is long past.

Changes

  • Microsoft.Android.Sdk.AssemblyResolution.targets — Remove the <AndroidWarning> block for XA1024
  • Resources.resx / Resources.Designer.cs — Remove the XA1024 resource string
  • BuildTest2.cs — Flip BuildBasicApplicationCheckConfigFiles assertion to verify XA1024 is not emitted
  • xa1024.md / index.md / TOC.yml — Mark XA1024 as removed

The XA1024 warning fired for any `.config` file in publish output,
causing false positives for files like `nuget.config`. Since .config
files are already excluded from publish output and the .NET 6
transition is long past, this warning is no longer necessary.

Fixes #10122

Agent-Logs-Url: https://github.com/dotnet/android/sessions/544b704c-92b2-4c05-a9d4-c5b582c74e47

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix false positive warning XA1024 for nuget.config Remove XA1024 warning for .config files May 1, 2026
Copilot AI requested a review from jonathanpeppers May 1, 2026 16:39
Comment thread src/Xamarin.Android.Build.Tasks/Properties/Resources.resx Outdated
Comment thread src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs Outdated
Comment thread Documentation/docs-mobile/TOC.yml Outdated
Comment thread Documentation/docs-mobile/messages/index.md Outdated
Comment thread Documentation/docs-mobile/messages/xa1024.md Outdated
….NET 11"

Agent-Logs-Url: https://github.com/dotnet/android/sessions/c5db2e6c-0570-4b44-8e11-41291a3ce67c

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
@jonathanpeppers

Copy link
Copy Markdown
Member

@copilot I think the NativeAOT case may have trimmer warnings, and we should skip the assertion:


BuildBasicApplicationCheckConfigFiles(NativeAOT)
build.log should have 0 MSBuild warnings.
Expected: True
But was:  False

Agent-Logs-Url: https://github.com/dotnet/android/sessions/2a573bbb-4e38-406d-ad4a-9404cc9f1e0a

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>

Copilot AI commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

@copilot I think the NativeAOT case may have trimmer warnings, and we should skip the assertion:


...

Wrapped the assertion with if (runtime != AndroidRuntime.NativeAOT) to skip it for the NativeAOT case, matching the pattern used in other tests (with the same TODO referencing #9784). Fixed in 0db05fa.

@jonathanpeppers
jonathanpeppers marked this pull request as ready for review May 4, 2026 13:36
Copilot AI review requested due to automatic review settings May 4, 2026 13:36
@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label May 4, 2026

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

Removes the XA1024 warning that was emitted for any .config file during publish item computation, since these files are already excluded from publish output and the warning was producing false positives (e.g., nuget.config). This aligns the SDK behavior and tests/docs with the removal of XA1024 for .NET 11.

Changes:

  • Removed the XA1024 <AndroidWarning> emission from Microsoft.Android.Sdk.AssemblyResolution.targets.
  • Deleted the XA1024 resource entry and generated accessor.
  • Updated tests and docs to reflect that XA1024 no longer exists.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets Removes the XA1024 warning emission from the publish item pipeline.
src/Xamarin.Android.Build.Tasks/Properties/Resources.resx Removes the XA1024 localized resource string (en-US).
src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs Removes the generated Resources.XA1024 accessor.
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs Updates BuildBasicApplicationCheckConfigFiles to no longer expect XA1024.
Documentation/docs-mobile/TOC.yml Removes XA1024 from the docs navigation TOC.
Documentation/docs-mobile/messages/xa1024.md Reworks the XA1024 page to state the warning is removed in .NET 11.
Documentation/docs-mobile/messages/index.md Updates the XA1024 entry to indicate it’s removed in .NET 11.
Files not reviewed (1)
  • src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs: Language not supported

Comment thread src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs
Comment thread Documentation/docs-mobile/messages/xa1024.md
@jonathanpeppers
jonathanpeppers merged commit 9d54ad1 into main May 4, 2026
7 checks passed
@jonathanpeppers
jonathanpeppers deleted the copilot/remove-xa1024-warning branch May 4, 2026 21:23
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

XA1024 false positive for nuget.config — consider removing the warning

4 participants