如何使用Azure移动服务(通过Xamarin.Auth?)? [英] How to use Azure Mobile Services (With Xamarin.Auth?)?

查看:64
本文介绍了如何使用Azure移动服务(通过Xamarin.Auth?)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我创建了一个Forms解决方案,在我的PCL项目中,添加了NuGet Microsoft.WindowsAzure.Mobile.

So I create a Forms solution, in my PCL project I add the NuGet Microsoft.WindowsAzure.Mobile.

当我运行Android项目(当然引用PCL项目)时,我得到:

When I run my Android project (which of course references the PCL project), I get:

[MonoDroid]例外: System.Reflection.TargetInvocationException:异常已发生 由调用目标抛出. ---> System.InvalidOperationException: 找不到用于当前平台的Microsoft Azure移动服务程序集. 确保当前项目同时引用Microsoft.WindowsAzure.Mobile和以下特定于平台的项目 程序集:Microsoft.WindowsAzure.Mobile.Ext.

[MonoDroid] UNHANDLED EXCEPTION: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: A Microsoft Azure Mobile Services assembly for the current platform was not found. Ensure that the current project references both Microsoft.WindowsAzure.Mobile and the following platform-specific assembly: Microsoft.WindowsAzure.Mobile.Ext.

好吧,我将Microsoft.WindowsAzure.Ext(通过手动编辑引用->浏览到..packages..Microsoft.WindowsAzure.Mobile.Ext程序集并将其添加)到我的Android项目中,但是然后我得到:

Ok, fine, I add the Microsoft.WindowsAzure.Ext (by manually Edit References->Browse to the ..packages..Microsoft.WindowsAzure.Mobile.Ext assembly and add it) to my Android project, but then I get:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: 错误:找到重复的托管类型!托管类型之间的映射 并且Java类型必须是唯一的.第一类: 'Xamarin.Auth.AndroidAccountStore/SecretAccount,Xamarin.Auth.Android, 版本= 1.2.2.0,文化=中性,PublicKeyToken =空';第二种类型: 'Xamarin.Auth.AndroidAccountStore/SecretAccount, Microsoft.WindowsAzure.Mobile.Ext,版本= 1.2.0.0,文化=中性, PublicKeyToken = 31bf3856ad364e35'(MyApp.Android)

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Duplicate managed type found! Mappings between managed types and Java types must be unique. First Type: 'Xamarin.Auth.AndroidAccountStore/SecretAccount, Xamarin.Auth.Android, Version=1.2.2.0, Culture=neutral, PublicKeyToken=null'; Second Type: 'Xamarin.Auth.AndroidAccountStore/SecretAccount, Microsoft.WindowsAzure.Mobile.Ext, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' (MyApp.Android)

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: 错误:找到重复的托管类型!托管类型之间的映射 并且Java类型必须是唯一的.第一类: 'Xamarin.Auth.FormAuthenticatorActivity,Xamarin.Auth.Android, 版本= 1.2.2.0,文化=中性,PublicKeyToken =空';第二种类型: 'Xamarin.Auth.FormAuthenticatorActivity, Microsoft.WindowsAzure.Mobile.Ext,版本= 1.2.0.0,文化=中性, PublicKeyToken = 31bf3856ad364e35'(MyApp.Android)

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Duplicate managed type found! Mappings between managed types and Java types must be unique. First Type: 'Xamarin.Auth.FormAuthenticatorActivity, Xamarin.Auth.Android, Version=1.2.2.0, Culture=neutral, PublicKeyToken=null'; Second Type: 'Xamarin.Auth.FormAuthenticatorActivity, Microsoft.WindowsAzure.Mobile.Ext, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' (MyApp.Android)

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: 错误:找到重复的托管类型!托管类型之间的映射 并且Java类型必须是唯一的.第一类: 'Xamarin.Auth.FormAuthenticatorActivity/State,Xamarin.Auth.Android, 版本= 1.2.2.0,文化=中性,PublicKeyToken =空';第二种类型: 'Xamarin.Auth.FormAuthenticatorActivity/State, Microsoft.WindowsAzure.Mobile.Ext,版本= 1.2.0.0,文化=中性, PublicKeyToken = 31bf3856ad364e35'(MyApp.Android)

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Duplicate managed type found! Mappings between managed types and Java types must be unique. First Type: 'Xamarin.Auth.FormAuthenticatorActivity/State, Xamarin.Auth.Android, Version=1.2.2.0, Culture=neutral, PublicKeyToken=null'; Second Type: 'Xamarin.Auth.FormAuthenticatorActivity/State, Microsoft.WindowsAzure.Mobile.Ext, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' (MyApp.Android)

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: 错误:找到重复的托管类型!托管类型之间的映射 并且Java类型必须是唯一的.第一类: 'Xamarin.Auth.WebAuthenticatorActivity,Xamarin.Auth.Android, 版本= 1.2.2.0,文化=中性,PublicKeyToken =空';第二种类型: 'Xamarin.Auth.WebAuthenticatorActivity, Microsoft.WindowsAzure.Mobile.Ext,版本= 1.2.0.0,文化=中性, PublicKeyToken = 31bf3856ad364e35'(MyApp.Android)

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Duplicate managed type found! Mappings between managed types and Java types must be unique. First Type: 'Xamarin.Auth.WebAuthenticatorActivity, Xamarin.Auth.Android, Version=1.2.2.0, Culture=neutral, PublicKeyToken=null'; Second Type: 'Xamarin.Auth.WebAuthenticatorActivity, Microsoft.WindowsAzure.Mobile.Ext, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' (MyApp.Android)

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: 错误:找到重复的托管类型!托管类型之间的映射 并且Java类型必须是唯一的.第一类: 'Xamarin.Auth.WebAuthenticatorActivity/State,Xamarin.Auth.Android, 版本= 1.2.2.0,文化=中性,PublicKeyToken =空';第二种类型: 'Xamarin.Auth.WebAuthenticatorActivity/State, Microsoft.WindowsAzure.Mobile.Ext,版本= 1.2.0.0,文化=中性, PublicKeyToken = 31bf3856ad364e35'(MyApp.Android)

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Duplicate managed type found! Mappings between managed types and Java types must be unique. First Type: 'Xamarin.Auth.WebAuthenticatorActivity/State, Xamarin.Auth.Android, Version=1.2.2.0, Culture=neutral, PublicKeyToken=null'; Second Type: 'Xamarin.Auth.WebAuthenticatorActivity/State, Microsoft.WindowsAzure.Mobile.Ext, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' (MyApp.Android)

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: 错误:找到重复的托管类型!托管类型之间的映射 并且Java类型必须是唯一的.第一类: 'Xamarin.Auth.WebAuthenticatorActivity/Client,Xamarin.Auth.Android, 版本= 1.2.2.0,文化=中性,PublicKeyToken =空';第二种类型: 'Xamarin.Auth.WebAuthenticatorActivity/Client, Microsoft.WindowsAzure.Mobile.Ext,版本= 1.2.0.0,文化=中性, PublicKeyToken = 31bf3856ad364e35'(MyApp.Android)

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Duplicate managed type found! Mappings between managed types and Java types must be unique. First Type: 'Xamarin.Auth.WebAuthenticatorActivity/Client, Xamarin.Auth.Android, Version=1.2.2.0, Culture=neutral, PublicKeyToken=null'; Second Type: 'Xamarin.Auth.WebAuthenticatorActivity/Client, Microsoft.WindowsAzure.Mobile.Ext, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' (MyApp.Android)

似乎与Xamarin.Auth冲突?

Seems to be some conflict with Xamarin.Auth?

我该如何解决?

推荐答案

从Mobile Services SDK 1.2.5版开始,此错误已解决.

This error is resolved as of version 1.2.5 of the Mobile Services SDK.

这篇关于如何使用Azure移动服务(通过Xamarin.Auth?)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆