Are Portable Class Libraries for Xamarin only?

This is a very basic question. Can Portable Class Libraries be used for simple classes that contain function libraries and no UI components?

Is it possible to write a non-UI class library and share it across multiple platforms?

Jon Skeet
people
quotationmark

Can Portable Class Libraries be used for simple classes that contain function libraries and no UI components?

Absolutely, although the more modern alternative to PCLs is .NET Core libraries. PCLs had various issues in terms of tooling and working out which profile you needed to use: the .NET Core model is much simpler. (There have been a few twists and turns along the way, with project.json etc, but the final .NET Core SDK is now out... You'll want Visual Studio 2017 to develop with it.)

Is it possible to write a non-UI class library and share it across multiple platforms?

Absolutely - that's precisely what projects like Noda Time and Json.NET do. (Disclaimer: I'm the main author of Noda Time, so clearly biased :)

There's a bit of subtlety here, in that portable projects are often distributed as NuGet packages, but there can be multiple different assemblies in the NuGet package, targeted at different frameworks. For example, Noda Time 2.0 targets netstandard1.3 and net45 - the netstandard1.3 assembly doesn't have support for binary serialization or as much support for TimeZoneInfo as the net45 assembly.

people

See more on this question at Stackoverflow