2016-01-04 192 views
0

我一直在使用Xamarin開發多個跨平臺移動項目。幾乎所有人都以某種方式使用SQLite。我一直爲我的SQLite功能維護兩個單獨的庫;一個用於iOS,一個用於Android。我一直在做的事情限制了我可以在Android和iOS版本的應用程序之間重複使用多少代碼。我想將我的大部分SQLite功能整合到單個跨平臺庫中,以便進一步整合代碼。SQLiteNetExtensions - NuGet無法安裝包

我遇到的問題是當我嘗試安裝SQLiteNetExtensions。我似乎只能將其安裝在Android或iOS項目上,但我無法將其安裝在PCL iOS/Android項目上。

這是我收到的時候我嘗試在包管理器控制檯安裝SQLiteNetExtensions錯誤:

Install failed. Rolling back... 
Install-Package : Could not install package 'SQLite.Net-PCL 3.0.5'. You are trying to install this package into a project that targets 'portable-net45+sl50+MonoAndroid10+xamarinios10+MonoTouch10', 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 SQLiteNetExtensions 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : NotSpecified: (:) [Install-Package], InvalidOperationException 
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand 

項目的類型,我在想,這是一個C#便攜式類庫。我選擇當我創建的項目,然後我選擇像這樣的目標框架:

enter image description here

然後,我右鍵單擊引用,然後選擇管理的NuGet包。我在搜索中輸入sqlitenetextensions,然後點擊Install for SQLite.Net Extensions-PCL。之後,我得到了錯誤。

當我創建Android或iOS庫項目並嘗試執行相同的sqlitenetextension安裝時,不會發生此錯誤。

我該如何解決這個問題?

回答