Search code examples
.netxamarinxamarin.androidxamarin.iosnuget

NuGet Compatible vs Computed Framework (Xamarin and .NET 6)


We are currently looking at migrating existing Xamarin.Android and Xamarin.iOS applications to .NET 6 (we aren't at this stage going to use MAUI).

A big part of this process is understanding which NuGet packages we need to update or replace.

We're just trying to understand the difference between a package being compatible with a framework, and a framework being an additionally computed framework.

We can see for some of the packages we are using that net6.0-ios and net6.0-android are additionally computed frameworks rather than being compatible. What does this mean in terms of whether or not a net6.0-ios or net6.0-android app could consume the package?


Solution

  • It really depends.

    Lets say you are trying to consume a package that only targets netstandard1.0 or above. That package will be totally fine to consume.

    However, if you are attempting to consume a package that has multiple targets, lets say

    • netstandard1.0
    • Xamarin.iOS
    • monoandroid13.0

    That package will only partially work. The netstandard stuff will definitely work. monoandroid13.0 will most likely work. However, since there are breaking changes between Xamarin.iOS and net6.0-ios then that part won't work.

    Most preferably, for packages that target a specific platform, that should at least be net6.0-android or net6.0-ios, otherwise you will encounter issues.