1
votes

When you use a .net standard lib from the full .net framework you end up having to include/deploy .net standard versions of all the System.* assemblies the .net standard library uses.

Now that Xamarin supports .net standard and microsoft is recommending people use .net standard rather than PCL we will soon need to switch (library developers are abandoning PCL support).

My question is does using a .net standard library in a Xamarin for Android project mean that multiple system assemblies will be deployed (the .net standard version and the mono version)?

Xamarin apps are already much bigger than native and having to include duplicates of all the system assemblies we need could be a deal breaker going forward.

1
Why not test it? That would answer your question with the exact information for your usecase. - tequila slammer
Yes I could test it, but it would require switching to .net standard which for our existing app is quite a bit of work. The information requested in this question is missing from all the Microsoft/Xamarin documentation. The answer to this question would be valuable to others looking at moving to .net standard and not just me. I believe this question has value. Not only that if you approach xamarin they tell you to ask your question here on stackoverflow. - trampster
This is a valid question, someone might have done the work on their app and knows the results. - Emmanuel Vazquez
Potentially a little bit better. My App shrank from ~30 MB to <20 MB. Your milage may vary depending on the nuget packages you use - knechtrootrecht

1 Answers

1
votes

The .NET Standard(s) define the API surface of each version. The implementation of the API surface lies with the platform.

In the case of Xamarin the surface is implemented in the Mono framework which is deployed with every app. (And has been before)

If you reference nothing but the NETStandard Library the final .apk file will not increase.

Additional NuGet packages might bring in extra NetStandard specific dependencies (which could previously have been handled by the .net / mono framework itself)