Skip to content

Remove XA1024 warning for .config files#11263

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/remove-xa1024-warning
Draft

Remove XA1024 warning for .config files#11263
Copilot wants to merge 4 commits intomainfrom
copilot/remove-xa1024-warning

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 1, 2026

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>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 1, 2026

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants