在 Xamarin 便携式 Class 库中使用 FluentMigrator

Using FluentMigrator in a Xamarin Portable Class Library

我在 VS 2017 Community Edition 中创建了一个 Xamarin Forms 项目。我想使用 FluentMigrator 创建一个数据库以在应用程序中使用。

当我尝试使用 NuGet PM 将 FluentMigrator 安装到项目中时,出现以下错误:

Could not install package 'FluentMigrator 1.6.2'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile259', but the package does not contain any assembly references or content files that are compatible with that framework. For more 
information, contact the package author.

我猜我的项目是 using.NETPortable。

是否可以在 Xamarin PCL 中使用 FluentMigrator?如果是这样,我的项目配置中需要更改什么?

FluentMigrator 没有任何与 PCL 项目兼容的程序集。它包含两个 lib 目录:35 和 40。这些目录似乎有用于 .NET 3.5 和 .NET 4.0 的 .NET 程序集。所以你不能将它安装到 PCL 项目中。

我想看看您是否可以只创建一个 .NET 项目,比如说以 .NET 4.5 为目标,然后将 FluentMigrator NuGet 包安装到该项目中并在那里定义您的迁移。