You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I read somewhere that Linking and Trimming are the same thing in MAUI context?. In any case I'm referring to the "Optimizing Assembly" build step with the disclaimer "https://aka.ms/dotnet-illink" which takes a long time and is only triggered for Release mode when AOT is on.
Description
Situation: Due to a bug which seems to be related to trimming/"optimizing for size" (which has been in there for ages, #16014), which basically breaks Android Push notifications, at least in the specific case I'm interested in, I figured leaving off Trimming/"optimizing for size" with AOT enabled would get me best of both worlds.
Compiling works fine in Debug mode with AOT and publishtrimmed not set, which does NOT trigger the linking process, which is shown in Output with Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
so I'm puzzled why linking/optimizingforsize must be on in release mode:
I cannot publish the app to the store in Debug mode,
and leaving off AOT deteriorates app startup performance.
The linking bit even comes with it's own disclaimer, but I figured AOT on it's own should be safe?
There's probably a good reason, or there was one at some point, for this behavior. I was interested in the story behind it, and hoping it could have been just a precaution I could work around in another way?
I upgraded to 8.0 rc2 to check if it was still in there. It is unfortunately.
Steps to Reproduce
Create project
Enable AOT for Release mode by setting RunAOTCompilation to true
Disable Trimming by setting PublishTrimmed to False
-compiler error-
Or:
Steps to Reproduce alternative
Create project
Enable AOT for Release mode by setting RunAOTCompilation to true
(don't set publishtrimmed, which sets it to True)
-notification not triggering-
Result: error XA1030: The 'RunAOTCompilation' MSBuild property is only supported when trimming is enabled. Edit the project file in a text editor to set 'PublishTrimmed' to 'true' for this build configuration.
Link to public reproduction project repository
No response
Version with bug
8.0.0-rc.2.9373
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
Disabling AOT obviously
Relevant log output
error XA1030: The 'RunAOTCompilation' MSBuild property is only supported when trimming is enabled. Edit the project file in a text editor to set'PublishTrimmed' to 'true'for this build configuration.
The text was updated successfully, but these errors were encountered:
jkommeren
changed the title
Trimming MUST be on for AOT
Trimming MUST be on for AOT, I don't really see why?
Oct 15, 2023
jkommeren
changed the title
Trimming MUST be on for AOT, I don't really see why?
Trimming MUST be on for AOT on Android in Release mode, I don't really see why?
Oct 15, 2023
Disclaimer
I read somewhere that Linking and Trimming are the same thing in MAUI context?. In any case I'm referring to the "Optimizing Assembly" build step with the disclaimer "https://aka.ms/dotnet-illink" which takes a long time and is only triggered for Release mode when AOT is on.
Description
Situation: Due to a bug which seems to be related to trimming/"optimizing for size" (which has been in there for ages, #16014), which basically breaks Android Push notifications, at least in the specific case I'm interested in, I figured leaving off Trimming/"optimizing for size" with AOT enabled would get me best of both worlds.
Compiling works fine in Debug mode with AOT and publishtrimmed not set, which does NOT trigger the linking process, which is shown in Output with
Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
so I'm puzzled why linking/optimizingforsize must be on in release mode:
The linking bit even comes with it's own disclaimer, but I figured AOT on it's own should be safe?
There's probably a good reason, or there was one at some point, for this behavior. I was interested in the story behind it, and hoping it could have been just a precaution I could work around in another way?
I upgraded to 8.0 rc2 to check if it was still in there. It is unfortunately.
Steps to Reproduce
Or:
Steps to Reproduce alternative
Result:
error XA1030: The 'RunAOTCompilation' MSBuild property is only supported when trimming is enabled. Edit the project file in a text editor to set 'PublishTrimmed' to 'true' for this build configuration.
Link to public reproduction project repository
No response
Version with bug
8.0.0-rc.2.9373
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
Disabling AOT obviously
Relevant log output
The text was updated successfully, but these errors were encountered: