2017-02-14 72 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软件包。

相关问题