2017-02-14 68 views
3

我試圖將我的項目從SQLite.Net-PCL轉換爲sqlite-net-pcl(最新穩定版本; 1.3.1),因爲它在Xamarin's working with databases上表示,但是當我安裝它,它必須安裝40包(左右)以下無法在Xamarin中安裝SQLite-Net-pcl

Microsoft.NETCore.Platforms 1.0.1 
Microsoft.NETCore.Targets 1.0.1 
runtime.native.System 4.0.0 
SQLitePCLRaw.core 1.1.2 
SQLitePCLRaw.bundle_green 1.1.2 
System.Collections 4.0.11 
System.Collections.Concurrent 4.0.12 
System.Diagnostics.Debug 4.0.11 
System.Diagnostics.Tools 4.0.1 
System.Diagnostics.Tracing 4.1.0 
System.Globalization 4.0.11 
System.IO 4.1.0 
System.IO.Compression 4.1.0 
System.Linq 4.1.0 
System.Linq.Expressions 4.1.0 
System.Net.Http 4.1.0 
System.Net.Primitives 4.0.11 
System.ObjectModel 4.0.12 
System.Reflection 4.1.0 
System.Reflection.Extensions 4.0.1 
System.Reflection.Primitives 4.0.1 
System.Resources.ResourceManager 4.0.1 
System.Runtime 4.1.0 
System.Runtime.Extensions 4.1.0 
System.Runtime.InteropServices 4.1.0 
System.Runtime.Numerics 4.0.1 
System.Text.Encoding 4.0.11 
System.Text.Encoding.Extensions 4.0.11 
System.Text.RegularExpressions 4.1.0 
System.Threading 4.0.11 
System.Runtime.InteropServices.RuntimeInformation 4.0.0 
System.Threading.Tasks 4.0.11 
System.Xml.ReaderWriter 4.0.11 
System.Xml.XDocument 4.0.11 
NETStandard.Library 1.6.0 
sqlite-net-pcl 1.3.1 

據我所知,它需要一些軟件包的上市,但似乎很多包在我身上。 我使用Xamarin.Forms版本2.3.3.180(最新的穩定)

如果我繼續安裝,這樣的錯誤發生

Could not install package 'System.Runtime.InteropServices.RuntimeInformation 4.0.0'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile111', 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. 

如何安裝源碼網-PCL,所以我可以繼續在Android N上使用SQLite嗎?

現在我有這些目標

.NET Framework 4.5 
Windows 8 
ASP.NET Core 1.0 (I do not know why this is set) 
Windows Phone 8.1 (I am not using this, but it says I have to reinstall all Nuget packages, if I want to remove it) 
Xamarin.Android 
Xamarin.iOS 
Xamarin.iOS (Classic) 
Xamarin.Mac (neither using this) 

我一定要刪除的目標,那我不使用並重新安裝所有的Nu​​Get包?

,我使用這些的NuGet包

Acr.UserDialogs 
ExifLib.PCL 
Microsoft.NETCore.UniversalWindowsPlatform 
MR.Gestures 
Newtonsoft.Json 
Xam.Plugin.Media 
Xam.Plugins.Settings 
Xamarin.Forms 
Xamarin.Insights 
Xamarin.UITest 
XLabs.Forms 
ZXing.Net.Mobile.Forms 

回答

7

您已經安裝了.NetStandard版本

發行說明V1.3.1:

切換到.NET標準

正如你可以看到 NETStandard.Library 1.6.0現在添加爲包。

我會刪除sqlite的淨PCL 1.3.1,它安裝了.NetStandard然後使用v1.2.1 ,因爲它仍然爲Android n個補丁,因爲它加入從here

V1 bundle_green其他包.2.1:更新.RAW到bundle_green 1.1.0

你可以閱讀更多關於修復here

+0

這是如果我以這種方式更新,我還需要更新到.NET Standard 1.6嗎? –

+0

嗯,我不認爲你將能夠從PCL中移除目標以使其工作。我認爲sqlite- net-pcl 1.2.1現在是正確的方式。在某些時候,你可以將你的PCL升級到.NetStandard,然後你可以使用sqlite-net-pcl 1.3.1,但是我不知道它如何與表單配合使用。這裏有一些鏈接https://xamarinhelp.com/dot-net-standard-pcl-xamarin-forms/ https://xamarinhelp.com/net-standard-xamarin-forms-gotchas/ –

+0

謝謝你的幫助Iain Smith –

1

恐怕你將不得不做,你說的話。我有一個類似的問題(幸運的是,這是一個新項目),我沒有其他辦法,然後這樣做。您將必須刪除每個nuget包,更改目標以刪除導致此錯誤的目標,然後重新安裝所有包。 我建議你逐個刪除目標並嘗試安裝sqlite。您將能夠隔離導致您錯誤的目標。

+0

感謝您的幫助丹尼爾,儘管我認爲這是一條很長的路要走,因爲我的很多NuGet軟件包都依賴於其他人:( 我有點想念力卸載依賴刪除 –

0

我有同樣的問題。我通過首先安裝'System.Runtime.InteropServices.RuntimeInformation 4.0.0'解決了我的問題,然後安裝了SQlite-pcl軟件包。

相關問題