【问题标题】:NullReferenceException when use Office 365 API in Xamarin.IOS在 Xamarin.IOS 中使用 Office 365 API 时出现 NullReferenceException
【发布时间】:2014-07-31 23:47:52
【问题描述】:

首先我遇到了这个问题: 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

【问题讨论】:

  • 请不要在外部网站上发布您的代码。花点时间识别代码的相关部分,并以正确的格式将其内联发布。
  • 该链接是我正在使用的应用程序,任何 ppl 都可以运行、测试并获取错误...我使用的代码是使用 Office365 API 添加到项目中的,我了解您的点,但我的经验是更容易拥有一个运行示例而不是无法重放错误的简单代码部分......

标签: ios xamarin ms-office office365


【解决方案1】:

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

https://github.com/saramgsilva/Office365RESTAPISample

【讨论】:

    【解决方案2】:

    您可能想查看这篇博文(请参阅 Xamarin 论坛中的链接)-Xamarin 开发人员能够使其在 Android 中运行

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

    【讨论】:

    猜你喜欢
    • 2015-04-05
    • 1970-01-01
    • 2014-08-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多