In my PCL project, I have used the dynamic initialization of objects code. So for xamarin linking process I have used the LinkerSafe attribute and Preserve attribute (added these attribute classes in my source as we don't have xamarin dependency).
I have generated the assembly from my PCL project MSBuild.exe command line in xamarin installed machine, which has no issues in the linking process. Assembly generated in the machine without xamarin tools throws an error on the linking process.
My question is whether we need xamarin tools installed for proper linker processed assembly?
This depends on the platform as both Android and iOS have a
LinkAssemblies
equivalent task that runs the Mono Linker and is executed at build time. Those tasks are invoked by Android and iOS projects that include the respective targets.There is an announcement of a .NET IL Linker based on the Mono Linker as well:
https://github.com/dotnet/announcements/issues/30 / https://github.com/dotnet/core/blob/master/samples/linker-instructions.md
It would be worth investigating your build via
MSBuild Log Viewer
andbinlog
:http://msbuildlog.com/