My work is currently using the mono linker to strip unused things from some
executables we produce. Several methods/classes are only used through
Reflection, and so get stripped when we don't want them to. I've produced
an additional step that prevents anything with a '[UsedImplicitly]'
attribute on it from getting removed (we already use this attribute to
prevent ReSharper from complaining about unused things, so this solution
for us is far easier than using the XML option to prevent the strip)
I doubt that this is generic enough to go into the mono linker (it uses
JetBrains.Annotations.UsedImplicitly as the only attribute it is looking
for at the moment) but it might be useful for some other people using the
linker. The GitHub repo with instructions is here:
https://github.com/krijesta/mono-linker-UsedImplicitly
Cheers,
Chris