【问题标题】:How to use or convert xamarin.forms pcl into xamarin native如何使用 xamarin.forms pcl 或将其转换为 xamarin native
【发布时间】:2020-03-28 04:35:36
【问题描述】:

我有一个 xamarin 项目到 Xamarin.forms PCL,我想将它转换/使用到 xamarin.forms 本机,我该怎么做。如果有办法请指导我。

提前感谢:)

【问题讨论】:

  • 您的意思是要将您的项目从 PCL 移植到 .NET Standard?
  • 您可以从链接中查看有关Convert A PCL Project Into .NET Standard Project 的教程。 c-sharpcorner.com/article/…

标签: xamarin xamarin.forms xamarin.android xamarin.ios


【解决方案1】:

您需要编辑项目文件并将目标框架设置为 netstandard(2/2.1)。然后,如果您重新加载项目,Visual Studio 将为您执行自动迁移。

将生成一个带有迁移日志的文件,其中可能包含有关与新框架不兼容的包的信息。旧项目文件(.csproj)也将自动备份。

您还应该删除 AssemblyInfo.cs 和 packages.json 文件。所有 nuget 包和引用都需要重新添加。

请参考以下指南:

Upgrade PCL to .NET Standard Class Library

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

【讨论】:

    猜你喜欢
    • 2016-12-15
    • 2018-10-06
    • 1970-01-01
    • 2011-07-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-14
    • 2015-12-07
    相关资源
    最近更新 更多