Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
Text="The %24(TargetFrameworkVersion) for $(ProjectName) ($(TargetFrameworkVersion)) is less than the minimum required %24(TargetFrameworkVersion) for Microsoft.Maui ($(MinTargetFrameworkVersionForMaui)). You need to increase the %24(TargetFrameworkVersion) for $(ProjectName)." />
</Target>

Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

This target now hooks an internal SDK target name (_PrepareTrimConfiguration) as a workaround. Please add a short XML comment on/above this target explaining the runtime issue/workaround and that it should be switched to PrepareTrimConfiguration once available, so future maintainers don’t remove or “clean up” the underscore target reference.

Suggested change
<!--
Intentionally hook the internal SDK target `_PrepareTrimConfiguration` as a workaround for
the current runtime/SDK trimming issue. Do not remove or "clean up" the underscore target
reference; switch this to `PrepareTrimConfiguration` once that public target is available.
-->

Copilot uses AI. Check for mistakes.
<Target Name="_MauiPrepareForILLink" BeforeTargets="PrepareForILLink;_GenerateRuntimeConfigurationFilesInputCache;XamlC">
<Target Name="_MauiPrepareForILLink" BeforeTargets="_PrepareTrimConfiguration;_GenerateRuntimeConfigurationFilesInputCache;XamlC">
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

Dropping PrepareForILLink from BeforeTargets makes this target rely on _PrepareTrimConfiguration being present/invoked to ensure the RuntimeHostConfigurationOption items are set before trimming. To keep the hook resilient across SDK/runtime target graph changes (and align with the original fix strategy), keep PrepareForILLink in the list as a fallback (and optionally add the future public PrepareTrimConfiguration name as well).

Suggested change
<Target Name="_MauiPrepareForILLink" BeforeTargets="_PrepareTrimConfiguration;_GenerateRuntimeConfigurationFilesInputCache;XamlC">
<Target Name="_MauiPrepareForILLink" BeforeTargets="PrepareForILLink;PrepareTrimConfiguration;_PrepareTrimConfiguration;_GenerateRuntimeConfigurationFilesInputCache;XamlC">

Copilot uses AI. Check for mistakes.
<PropertyGroup>
<MauiEnableIVisualAssemblyScanning Condition="'$(MauiEnableIVisualAssemblyScanning)' == ''">false</MauiEnableIVisualAssemblyScanning>
</PropertyGroup>
Expand Down
Loading