I currently have a Portable Class Library
whose code is entirely compatible with a regular Class Library
without any modification.
I was wondering if there was an existing software to do the conversion automatically ; I looked into the Visual Studio tools but could not find any suitable. Before writing my own I just wanted to be sure!
NET Standard is platform-agnostic, it can run anywhere, on Windows, Mac, Linux and so on. PCLs can also run cross-platform, but they have a more limited reach. PCLs can only target a limited set of platforms.
Right-click on the solution in Solution Explorer and select Add > New Project. On the Add a new project page, enter library in the search box. Choose C# or Visual Basic from the Language list, and then choose All platforms from the Platform list. Choose the Class Library template, and then choose Next.
The Portable Class Library project enables you to write and build managed assemblies that work on more than one . NET Framework platform. You can create classes that contain code you wish to share across many projects, such as shared business logic, and then reference those classes from different types of projects.
The differences will be in your .proj file.
Having tried it myself you will have to do all of the following;
<TargetFrameworkProfile>
element<ProjectTypeGuids>
element1. Regular class library
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
2. Portable class library
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
Use VSCommands, it has as a build in functionality to convert Projects to PCL. Right mouse click on Project and convert. It´s free and part of Visual Studio extensions http://vscommands.squaredinfinity.com/Features-SolutionExplorer
Update 2016-10-12: Above link is dead. The tool has been rewritten for Visual Studio 2015 and can be found here: https://visualstudiogallery.msdn.microsoft.com/c84be782-b1f1-4f6b-85bb-945ebc852aa1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With