Convert a PCL to a regular Class Library

∥☆過路亽.° 提交于 2019-11-26 16:33:37

问题


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!


回答1:


The differences will be in your .proj file.

Having tried it myself you will have to do all of the following;

  1. Remove the <TargetFrameworkProfile> element
  2. Remove the <ProjectTypeGuids> element
  3. Change where you have #2 (below) for what I shown in #1

1. Regular class library

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

2. Portable class library

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



回答2:


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



来源:https://stackoverflow.com/questions/20094075/convert-a-pcl-to-a-regular-class-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!