Project Description
Portable Class Libraries Contrib (PclContrib) provides portable adapters and APIs that help bridge the gap between different .NET platforms when using the new Portable Class Library feature. This makes it easier to convert existing platform-specific projects over to use portable APIs.

The Portable Class Library feature, available as an add-on for Visual Studio 2010 and in the box for Visual Studio 2012, enables you to share common code between platforms using a single "portable" project.

When converting existing projects over to portable projects, you will likely run into APIs that aren't available because they are not provided by every platform. This is where PclContrib comes in; it provides platform-agnostic versions and adapters of these APIs enabling them to be consumed by portable projects.

Using PclContrib is easy:
  1. From your 'portable' project, add a reference to Portable.Runtime, and optionally one or more of the Portable.* assemblies from below
  2. From .NET Framework (WPF, Windows Forms, or ASP.NET) projects, add a reference to Portable.Desktop
  3. From Silverlight projects, add a reference to Portable.Silverlight
  4. From Windows Phone projects, add a reference to Portable.Phone
  5. From Windows Store apps, add a reference to Portable.Store.

That's it.

PclContrib currently provides the following assemblies:

Portable.Runtime
System.Net.WebUtility (for encoding/decoding HTML)
System.Diagnostics.Stopwatch
Extension 'Close' methods for IDisposable types

Portable.Reflection
Provides extension methods for retrieving a ICustomAttributeProvider from reflection objects, such as Type, MemberInfo, etc.

Portable.ComponentModel.Async
System.ComponentModel.BackgroundWorker
System.ComponentModel.AsyncOperation
System.ComponentModel.AsyncOperationManager

Portable.Security.Cryptography
System.Security.Cryptography.AesManaged
System.Security.Cryptography.HMACSHA1
System.Security.Cryptography.HMACSHA256
System.Security.Cryptography.SHA1Managed
System.Security.Cryptography.SHA256Managed
System.Security.Cryptography.Rfc2898DeriveBytes

Portable.Security.Cryptography.ProtectedData (.NET 4.x, Windows Store and Windows Phone 7.5 only)
System.Security.Cryptography.ProtectedData

We will continue to add support for new APIs as we find more gaps. If you would like to see something added, feel free to file a bug.

Also, check out our frequentely asked questions.

Last edited Nov 10, 2012 at 9:49 PM by davkean, version 49