在 Xamarin 可移植类库中使用 FluentMigrator



我在VS 2017社区版中创建了一个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.

我猜这是我的项目正在使用的事实。净值。

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

FluentMigrator 没有任何与 PCL 项目兼容的程序集。它包含两个库目录:35 和 40。它们似乎具有用于 .NET 3.5 和 .NET 4.0 的 .NET 程序集。因此,您无法将其安装到 PCL 项目中。

相反,我会看看您是否可以创建一个 .NET 项目,例如面向 .NET 4.5,并将 FluentMigrator NuGet 包安装到该项目中并在那里定义迁移。

最新更新