C
C#11mo ago
Remaetanju

AOT Compilation trimming

hi, i have a nuget package that i use in my code (a client api to download from mega) when i AOT compile my code, it runs but there is an exception It catches that tell me the package doesnt work (simple login anon that should not fail) I think the trimmer remove too much code from the nuget package, causing it to breaks is there an option to exclude this nuget package from being trimmed ? so i could test it im on .net 8.0
6 Replies
cap5lut
cap5lut11mo ago
https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/trimming-options?pivots=dotnet-8-0#trimming-granularity seems u can set the mode to partial but then u will have to list all packages u want to trim
Remaetanju
RemaetanjuOP11mo ago
Ill give it a try today and come back to u Hi, i tried to use mode partial but seems that the library code is still trimmed. like publishAOT doesnt refer to trimMode and relative settings
Remaetanju
RemaetanjuOP11mo ago
Here the complete output I found properties to use and apparently disable trimming on some libraries (exe size going up) (build success but exe crashes later than before without the newly founds properties)
Remaetanju
RemaetanjuOP11mo ago
and the properties i use
Remaetanju
RemaetanjuOP11mo ago
<EnableTrimAnalyzer>true</EnableTrimAnalyzer> seems to be iimportant to always have warnings about trimm in the console <IsTrimmable>true</IsTrimmable> seems important otherwise trimmable assembly doesnt work ?
Want results from more Discord servers?
Add your server