将Microsoft.WindowsAzure.Mobile.SQLStore迁移到Microsoft.Azure.Mobile.Client.SQLiteStore

时间:2017-06-13 17:47:17

标签: azure xamarin xamarin.forms azure-mobile-services

我正在尝试使用 Microsoft.Azure更新弃用的Microsoft.WindowsAzure.Mobile.SQLStore pacakge的 Xamarin.Forms应用 .Mobile.Client.SQLiteStore 包但是当我尝试在我的Core pcl项目中安装包时出现以下错误:

Could not install package 'Microsoft.Azure.Mobile.Client.SQLiteStore 4.0.0'. 
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.

我试图关注this documentation,但他们似乎忘记添加代码示例,因此我无法弄清楚他们在做什么。不推荐使用的Microsoft.WindowsAzure.Mobile.SQLStore软件包安装在PCL库中,但新的Microsoft.Azure.Mobile.Client.SQLiteStore软件包似乎没有。

任何帮助都将不胜感激。

3 个答案:

答案 0 :(得分:2)

事实证明,Microsoft.Azure.Mobile.Client.SQLiteStore 4.0.0不再支持PCL,但他们转向.NET Standard 1.4。 PCL支持在3.1.0版本停止

因此,如果您使用的是PCL install v3.1.0。但在安装v3.1.0之前,请确保首先手动删除已弃用的Microsoft.WindowsAzure.Mobile.SQLStore。

请查看此问题以获取更多详细信息:https://github.com/Azure/azure-mobile-apps-net-client/issues/337

答案 1 :(得分:0)

您可以尝试打开PCL的.csproj,并用NuGet包支持的配置文件替换Profile78条目(可能是Profile259,其中包括除了windows phone silverlight之外的所有内容)

如果您的项目在更改个人资料后无法编译(因为缺少类型参考,例如),请尝试选择包支持的其他个人资料。

如果您有多个PCL,则可能需要更改所有PCL的目标配置文件。

答案 2 :(得分:0)

尝试将.Net个人资料更改为个人资料7 ,然后进行更新。 转到跨平台项目选项 - >构建 - >常规 - > .Net便携式