Entity Framework 7目前作爲一個Beta版和this article說,它是(會?)可以使用實體框架7 Xamarin項目。實體框架7 Xamarin.Forms
然而,當我嘗試使用的NuGet來安裝它:
Install-Package EntityFramework.SQLite –Pre
它會失敗:
Install-Package : Could not install package 'EntityFramework.Sqlite 7.0.0-beta6'. You are trying to install this package into a
project that targets '.NETPortable,Version=v4.5,Profile=Profile78', 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.
At line:1 char:1
+ Install-Package EntityFramework.SQLite –Pre
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
有沒有辦法在Xamarin項目中使用實體框架或我將不得不堅持與sqlite-net?
編輯:作爲@Daniel Luberda建議,我只是嘗試安裝實體框架到從Xamarin.Forms共享項目模板創建了一個項目,但是這個失敗,出現以下錯誤:
Install-Package : Could not install package 'System.Runtime 4.0.20-beta-23109'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v5.1', 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.
At line:1 char:1
+ Install-Package EntityFramework.SQLite –Pre
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
同對於Windows Phone項目和iOS項目是如此。
你嘗試與共享項目,而不是PCL項目中使用它? EF7仍處於測試階段。 –
不,我還沒有測試過,但我會!在此先感謝:) –
正如我在編輯中指出的那樣,嘗試將實體框架安裝到從共享項目模板創建的項目中也無效。 –