在Xamarin.IOS中使用Office 365 API时出现NullReferenceException

时间:2014-07-02 21:28:11

标签: ios xamarin ms-office office365

首先我遇到了这个问题: Using Office 365 API in Xamarin.Android

现在在Xamarin IOS中进行测试我得到了另一个:(

{System.NullReferenceException: Object reference not set to an instance of an object
  at Microsoft.Office365.OAuth.Authenticator.GetRefreshToken (System.String resource) [0x00000] in <filename unknown>:0 
  at Microsoft.Office365.OAuth.Authenticator+<GetAuthenticationResult>d__c.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000b] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.ExceptionServices/ExceptionDispatchInfo.cs:62 
  at System.Runtime.CompilerServices.TaskAwaiter`1[Microsoft.Office365.OAuth.AuthenticationInfo].GetResult () [0x00034] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter_T.cs:59 
  at Microsoft.Office365.OAuth.Authenticator+<AuthenticateAsync>d__6.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000b] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.ExceptionServices/ExceptionDispatchInfo.cs:62 
  at System.Runtime.CompilerServices.TaskAwaiter`1[Microsoft.Office365.OAuth.AuthenticationInfo].GetResult () [0x00034] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter_T.cs:59 
  at Office365InXamarinApps.ViewModel.ContactsViewModel+<EnsureClientCreated>d__9.MoveNext () [0x00046] in c:\DevApps\GitHub\Office365InXamarinApps\scr\Office365InXamarinApps\Office365InXamarinApps\ViewModel\ContactsViewModel.cs:76 }

代码在这里:https://github.com/saramgsilva/Office365InXamarinApp

2 个答案:

答案 0 :(得分:1)

Office 365 API预览存在问题,我无法使用它,因此我使用Office 365 REST API创建了另一个演示。

https://github.com/saramgsilva/Office365RESTAPISample

答案 1 :(得分:0)

您可以查看此博客文章(请参阅Xamarin论坛中的链接)-Xamarin开发人员能够在Android中使用它

http://forums.xamarin.com/discussion/21367/put-some-office-365-in-your-apps