As of today, Xamarin.iOS only exists as a Xamarin.iOS10, regardless of the installed version of the underlying mono BCL version.
This creates situations where new APIs are added (e.g. Dictionary<>.GetValueOrDefault or Array.Empty<T>() that were added recently) where that can create backward compatibility issues. Compiling a library using the latest VS might produce code that may not be valid using a previous version of Xamarin. Previous versions of Xamarin are very often used in the context of build servers, and/or for long standing applications where updating to the latest Xamarin build may not make sense (particularly VS2015 vs. VS2017).
Both Xamarin.iOS and Xamarin.Android have this issue, and there should be a way to include in the TargetFramework the mono version that was used to build an assembly, and the Xamarin installer should provide a way to install the different framework versions, the same way netcore and netfx are published today.
I can imagine this to be an issue for libraries only. However if you are writing general purpose library we already suggest to target/use netstandard which has targetable API.
@marek This is a library only issue indeed.
The libraries I'm talking about are iOS and Android specific libraries, netstandard does not apply in this context.
Why do you think netstandard does not apply in this context? You can achieve what you asked for by targeting netstandard
The libraries I'm developing explicitly use iOS and Android APIs, therefore those cannot be built using netstandard.
Yet another case of flip/flop for APIs being added moved: https://github.com/mono/corefx/blob/master/src/System.Collections/src/System/Collections/Generic/CollectionExtensions.cs#L9 in reaction to this thread: https://github.com/xamarin/xamarin-android/pull/631#issuecomment-321092650
The presence of the method on Dictionary<K,V> was breaking binary compatibility for code that references a later version of Xamarin, and now, this creates a compilation break because two extension methods with the same signature fail with an ambiguous match.
Allowing for specific framework versions would again greatly help.