Close this search box.

VS2012 – How to manually convert .NET Class Library to a Portable Class Library

The portable libraries are the  response to the growing profile fragmentation in .NET frameworks. With help of portable libraries you can share code between different runtimes without dreadful


statements or even worse “Add as Link” source file sharing practices.

If you have an existing .net class library which you would like to reference from a different runtime (e.g. you have a .NET Framework 4.5 library which you would like to reference from a Windows Store project), you can either create a new portable class library and move the classes there or edit the existing .csproj file and change the XML directly. The following example shows how to convert a .NET Framework 4.5 library to a Portable Class Library.

First Unload the Project and change the following settings in the .csproj file:

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable
\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />

and add the following keys to the first property group in order to get visual studio to show the framework picker dialog:


After that you can select the frameworks in the Library Tab of the Portable Library:

As last step, delete any framework references from the library as you have them already referenced via the .NET Portable Subset.

[1] Cross-Platform Development with the .NET Framework –

[2] Framework Profiles in .NET:

This article is part of the GWB Archives. Original Author: Igor Milovanović

Related Posts