Search code examples
c#windows-phone-8portable-class-librarycsproj

Converting a Class Library (e.g., WP8, Windows Store) into a Portable Class Library


Say, I have created and extended a Windows Phone Class Library (WPCL) project or any other Class Library project that targets a specific platform.

Say, I am now considering targeting another .NET platform, e.g., Windows Store, but at the time of creating my Class Library I chose to create a platform specific Class Library (such as my WPCL) and not a Portable Class Library (PCL).

The source code written is portable, it just requires a PCL project file (csproj).

From WPCL and PCL csproj comparison it seems that only a couple of properties differ. But do I need to hack the csproj to get the work done?

Basically, I want to know whether,

is there a way, to automatically convert a platform-specific Class Library into a Portable Class Library without hacking csproj files?


Solution

  • No, there's not currently a way to do this. If your code is entirely portable I'd suggest switching to a PCL. I think he best way to do this is to create a new PCL project in the same folder, edit the portable .csproj and copy the items from your platform-specific project file, then delete the platform-specific project and rename the portable one to the same name as the old platform-specific one.