Skip to content

Commit cbc1946

Browse files
MrJuljmacato
authored andcommitted
Fixed NativeAOT on .NET 9 (#15705)
Co-authored-by: Jumar Macato <[email protected]>
1 parent 798efeb commit cbc1946

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/Avalonia/AvaloniaBuildTasks.targets

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,16 @@
169169
</ItemGroup>
170170
</Target>
171171

172-
<!-- For some reason the IL Compiler hardcodes $(IntermediateOutputPath)$(TargetName)$(TargetExt) instead of using @(IntermediateAssembly), change that to our assembly. -->
172+
<!--
173+
For some reason the IL Compiler hardcodes $(IntermediateOutputPath)$(TargetName)$(TargetExt)
174+
instead of using @(IntermediateAssembly), change that to our assembly.
175+
This is fixed in .NET 9.0 (https://github.com/dotnet/runtime/pull/99732)
176+
-->
173177
<Target Name="InjectIlcAvaloniaXamlOutput"
174178
DependsOnTargets="InjectAvaloniaXamlOutput"
175179
AfterTargets="ComputeIlcCompileInputs"
176180
BeforeTargets="PrepareForILLink"
177-
Condition="'@(AvaloniaResource)@(AvaloniaXaml)' != '' AND $(EnableAvaloniaXamlCompilation) != false">
181+
Condition="$([MSBuild]::VersionLessThan($(TargetFrameworkVersion), '9.0')) AND '@(AvaloniaResource)@(AvaloniaXaml)' != '' AND $(EnableAvaloniaXamlCompilation) != false">
178182
<ItemGroup>
179183
<ManagedBinary Remove="$(IntermediateOutputPath)$(TargetName)$(TargetExt)" />
180184
<ManagedBinary Include="@(_AvaloniaXamlCompiledAssembly)" />

0 commit comments

Comments
 (0)