I have the following dependencies in my .nuspec file:
After thoroughly reading
https://docs.microsoft.com/en-us/nuget/reference/nuspec#dependencies-element
https://docs.microsoft.com/en-us/nuget/reference/target-frameworks
https://docs.microsoft.com/en-us/xamarin/cross-platform/app-fundamentals/nuget-manual
it can be summed up to:
Version 2.0+
As an alternative to a single flat list, dependencies can be specified according to the framework profile of the target project using elements within .
Each group has an attribute named targetFramework and contains zero or more elements. Those dependencies are installed together when the target framework is compatible with the project's framework profile.
The element without a targetFramework attribute is used as the default or fallback list of dependencies. See Target frameworks for the exact framework identifiers.
Therefore in my case it would be:
This way when I'm installing the package on the .netstandard project it will check the targetFramework and see that it's not MonoAndroid and it will fallback to the element without a targetFramework and use only Dep1, Dep2 and Dep3. For the MonoAndroid10 project it will do the same and use all of them.