C
C#2mo ago
cypherpotato

✅ Disable trimming for certain assemblies

Hello. There's a way to disable code trimming for certain assemblies? I just want to AOT-Compile my application, but trim only CLR assemblies and not the principal assembly. My code does use a lot of dynamic code, so it would be trimmed on an AOT-compilation. Thank you.
4 Replies
cypherpotato
cypherpotato2mo ago
Well I think i got it working with
<ItemGroup>
<TrimmerRootAssembly Include="MyAssembly" />
</ItemGroup>
<ItemGroup>
<TrimmerRootAssembly Include="MyAssembly" />
</ItemGroup>
reflectronic
reflectronic2mo ago
you can use <TrimMode>partial</TrimMode> to disable trimming for all assemblies which are not marked as trimmable it might be easier than going through and testing and rooting each further assembly which does not work
cypherpotato
cypherpotato2mo ago
but will it work for AOT compilation?