Reputation: 1634
I have a bit of C# / .NET experience, but I am fairly new to using Portable Class Libraries (PCLs) and writing code for Xamarin.iOS
My general understanding is 'regular' DLL in Visual Studio it will depend on, say, .NET 4.x, which has plenty of native dependencies.
In contrast, so I thought, PCL profiles denote a (meta) subset of APIs provided by the platform, and PCLs target these profiles and will be totally platform independent.
What confuses me now is that a number of 'portable' libraries (Portable Compression for example but there are many more), also require native dependencies.
Doesn't this defeat the purpose of PCLs? If not, why are they called 'portable', and what is their difference to regular IL assemblies?
Upvotes: 1
Views: 185
Reputation: 941217
What makes it "portable" is that you can use the package in different kind of projects and write the same code to use it. What is never portable is deployment, you use a very different way to get your program and its libraries deployed to, say, a phone vs a desktop machine.
Nuget packages like that always include a Powershell script that runs when you add the package. They look at your project to know what DLL needs to be copied. The package usually include them all but you'll use only one specific set of them. The one that can run on the specific device you selected. Which is for one why the blog post points out that you cannot target AnyCPU, the Powershell script needs to know whether to copy the 32-bit or the 64-bit version of the native DLL.
More details about this script and a way to get the DLLs deployed in this post.
Upvotes: 1