Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Documentation/docs-mobile/TOC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,6 @@
href: messages/xa1011.md
- name: XA1023
href: messages/xa1023.md
- name: XA1024
href: messages/xa1024.md
- name: XA1025
href: messages/xa1025.md
- name: XA1027
Expand Down
2 changes: 1 addition & 1 deletion Documentation/docs-mobile/messages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ or 'Help->Report a Problem' in Visual Studio for Mac.
+ XA1021: Specified source Java library not found: {file}
+ XA1022: Specified reference Java library not found: {file}
+ [XA1023](xa1023.md): Using the DX DEX Compiler is deprecated.
+ [XA1024](xa1024.md): Ignoring configuration file 'Foo.dll.config'. .NET configuration files are not supported in .NET for Android projects that target .NET 6 or higher.
+ XA1024: Removed in .NET 11.
+ [XA1025](xa1025.md): The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI.
+ [XA1027](xa1027.md): The 'EnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'.
+ [XA1028](xa1028.md): The 'AndroidEnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'.
Expand Down
38 changes: 8 additions & 30 deletions Documentation/docs-mobile/messages/xa1024.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,17 @@
---
title: .NET for Android warning XA1024
description: XA1024 warning code
ms.date: 04/11/2024
description: XA1024 warning code (removed)
ms.date: 05/01/2026
f1_keywords:
- "XA1024"
---

# .NET for Android warning XA1024

## Example messages
This warning has been removed in .NET 11.

```
warning XA1024: Ignoring configuration file 'Foo.dll.config'. .NET configuration files are not supported in .NET for Android projects that target .NET 6 or higher.
```

## Issue

No support for [configuration files][config] such as `Foo.dll.config`
or `Foo.exe.config` is available in .NET for Android projects.
[`<dllmap>`][dllmap] configuration elements are not
supported in .NET 6 at all, and other element types for compatibility
packages like [System.Configuration.ConfigurationManager][nuget] have
never been supported in .NET for Android projects.

[config]: /dotnet/framework/configure-apps/
[nuget]: https://www.nuget.org/packages/System.Configuration.ConfigurationManager/

## Solution

Use a supported alternative for [`<dllmap>`][dllmap], such as the
[NativeLibrary][native] API.

Use an alternative for application settings such as
[Preferences][preferences] in Xamarin.Essentials.

[dllmap]: https://github.com/dotnet/coreclr/blob/master/Documentation/design-docs/dllmap.md
[native]: /dotnet/api/system.runtime.interopservices.nativelibrary
[preferences]: /xamarin/essentials/preferences
The warning was previously issued for `.config` files included in the
build output, but it produced false positives for unrelated files such
as `nuget.config`. Since `.config` files are already excluded from the
publish output and the .NET 6 transition period is long past, the
warning is no longer necessary.
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ _ResolveAssemblies MSBuild target.
<ResolvedFileToPublish Remove="@(ResolvedFileToPublish)" />
<ResolvedFileToPublish Include="@(_DeduplicatedResolvedFileToPublish)" />
</ItemGroup>
<AndroidWarning
Code="XA1024"
ResourceName="XA1024"
FormatArguments="%(_SourceItemsToCopyToPublishDirectory.Identity)"
Condition=" '%(Extension)' == '.config' "
/>
</Target>

<Target Name="_FixupIntermediateAssembly" Condition=" '$(_OuterIntermediateAssembly)' != '' ">
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/Xamarin.Android.Build.Tasks/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -458,11 +458,6 @@ In this message, the term "binding" means a piece of generated code that makes i
<value>Using the DX DEX Compiler is not supported. Please set the DEX compiler to 'd8' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidDexTool' MSBuild property to 'd8'.</value>
<comment>The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool.</comment>
</data>
<data name="XA1024" xml:space="preserve">
<value>Ignoring configuration file '{0}'. .NET configuration files are not supported in .NET for Android projects that target .NET 6 or higher.</value>
<comment>The following are literal names and should not be translated: .NET, .NET for Android.
{0} - The file name such as 'Foo.dll.config'</comment>
</data>
<data name="XA1025" xml:space="preserve">
<value>The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property.</value>
<comment>The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis'</comment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2066,7 +2066,10 @@ public void BuildBasicApplicationCheckConfigFiles ([Values] AndroidRuntime runti
};
proj.OtherBuildItems.Add (config);
Assert.IsTrue (b.Build (proj), "Build should have succeeded.");
StringAssertEx.Contains ("XA1024", b.LastBuildOutput, "Output should contain XA1024 warnings");
// TODO: NativeAOT has trimmer warnings: https://github.com/dotnet/android/issues/9784
if (runtime != AndroidRuntime.NativeAOT) {
b.AssertHasNoWarnings ();
}
}
}

Expand Down