I'm getting this error when building my Xamarin solution for iOS.
I have enabled link SDK assemblies only.
Strange thing is, it works just fine when I build it for the simulator, but when I build for a real device it gives this error.
MTOUCH: error MT2002: Failed to resolve "System.Void
System.Security.Cryptography.SHA1Cng::.ctor()" reference from
"System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
No where in my code am I refering to System.Security.Cryptography.
It works when I disable linking assemblies, or enable link all assemblies, but linking all will cause Unity IoC to fail and disable linking all together results in a larger file size for the app.
I'm building for target OS 7.1 (no difference when I change that) for .NET version 4.5.2 and all updates for Xamarin are installed.
Update:
I can confirm that my iOS project is referring to System.Core version 2.0.5.0
See the screenshot below.
However, I do have a PCL project that is referenced. Could that somehow cause the issue?
UPDATE:
Turns out there is a library that I was referencing, HashLib, which I thought was a PCL but actually isn't.
Within HashLib there was a call to something in System.Core which caused the linker to fail.
I have now extracted the functionality I needed from HashLib and compiled it into a separate PCL project and this has fixed my linker issue.