Skip to content

Instantly share code, notes, and snippets.

@poychang
Forked from yuv4ik/README.md
Last active November 9, 2018 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poychang/5fe9fb534bbe37e2128d356082ff8d30 to your computer and use it in GitHub Desktop.
Save poychang/5fe9fb534bbe37e2128d356082ff8d30 to your computer and use it in GitHub Desktop.
[將 PCL 轉換成 .NET Standard] #dotnet #xamarin

Source: https://montemagno.com/how-to-convert-a-pcl-library-to-net-standard-and-keep-git-history/

How to Convert a Portable Class Library to .NET Standard and Keep Git History

  • Unload your PCL project (right click -> unload), and start editing it (right -> click edit)
  • Delete Everything in the csproj and insert this:
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <!--<PackageReference Include="" Version=""/>-->
  </ItemGroup>

</Project>
  • Add back NuGets (simply open packages.config, and add the package references above, or via the NuGet package manager.
  • Delete AssemblyInfo.cs (this is now in the csproj) and packages.config (also in csproj via PackageReference)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment