我已经从 Git Hub 下载了 Office 365 API 多租户示例,该示例可以读取联系人。
我对其进行了配置并运行它以查看它是否适用于联系人并且它工作正常。
之后我更改了代码以从我的邮箱中读取所有事件。
就像在这篇文章的初始请求中一样,有以下错误消息
[DataServiceClientException: Fehler beim Verarbeiten des Antwortdatenstroms。 Esist ein Fehler mit der folgenden Nachricht auf dem Server aufgetreten:
对象引用未设置为对象的实例。]
托管的 Office 365 API 与我自己调用其余的 API 有什么不同,或者 Office 365 API 中是否还有其他需要修复的地方?
这是完整的堆栈跟踪:
[ODataErrorException:Aus der Nutzlast wurde ein Fehler gelesen。 Weitere Informationen finden Sie in der Error-Eigenschaft.]
Microsoft.OData.Core.Json.BufferingJsonReader.ProcessObjectValue() +188
Microsoft.OData.Core.Json.BufferingJsonReader.ReadNextAndCheckForInStreamError() +95
Microsoft.OData.Core.Json.BufferingJsonReader.ReadInternal() +227
Microsoft.OData.Core.Json.BufferingJsonReader.Read() +5
Microsoft.OData.Core.JsonLight.ODataJsonLightEntryAndFeedDeserializer.ReadFeedContentStart() +56
Microsoft.OData.Core.JsonLight.ODataJsonLightReader.ReadFeedStart(ODataFeed 提要,SelectedPropertiesNode selectedProperties)+24
Microsoft.OData.Core.JsonLight.ODataJsonLightReader.ReadAtStartImplementationSynchronously(DuplicatePropertyNamesChecker duplicatePropertyNamesChecker)+175
Microsoft.OData.Core.JsonLight.ODataJsonLightReader.ReadAtStartImplementation() +69
Microsoft.OData.Core.ODataReaderCore.ReadImplementation() +42
Microsoft.OData.Core.ODataReaderCore.ReadSynchronously() +5
Microsoft.OData.Core.ODataReaderCore.InterceptException(Func`1 动作)+96
Microsoft.OData.Core.ODataReaderCore.Read() +68
Microsoft.OData.Client.Materialization.ODataReaderWrapper.Read() +18
Microsoft.OData.Client.Materialization.FeedAndEntryMaterializerAdapter.TryRead() +30
[DataServiceClientException: Fehler beim Verarbeiten des Antwortdatenstroms。 Esist ein Fehler mit der folgenden Nachricht auf dem Server aufgetreten:
你调用的对象是空的。]
Microsoft.OData.Client.Materialization.FeedAndEntryMaterializerAdapter.TryRead() +97
Microsoft.OData.Client.Materialization.FeedAndEntryMaterializerAdapter.TryStartReadFeedOrEntry() +13
Microsoft.OData.Client.Materialization.FeedAndEntryMaterializerAdapter.TryReadFeedOrEntry(Boolean lazy, ODataFeed& feed, MaterializerEntry& entry) +20
Microsoft.OData.Client.Materialization.FeedAndEntryMaterializerAdapter.Read() +138
Microsoft.OData.Client.Materialization.ODataReaderEntityMaterializer.ReadNextFeedOrEntry() +10
Microsoft.OData.Client.Materialization.ODataEntityMaterializer.ReadImplementation() +51
Microsoft.OData.Client.MaterializeAtom.MoveNextInternal() +348
Microsoft.OData.Client.MaterializeAtom.MoveNext() +68
System.Linq.d__11.MoveNext() +176
System.Collections.Generic.List1..ctor(IEnumerable1 collection) +387
System.Linq.Enumerable.ToList(IEnumerable1 源) +58
Microsoft.OData.ProxyExtensions.PagedCollection2..ctor(DataServiceContextWrapper context, QueryOperationResponse1 qor) +53
Microsoft.OData.ProxyExtensions.c__DisplayClass382.<ExecuteAsync>b__36(IAsyncResult r) +167
System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization) +86
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +99
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
Microsoft.OData.ProxyExtensions.<ExecuteAsync>d__3a2.MoveNext() +686
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)+99
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)+58
System.Runtime.CompilerServices.TaskAwaiter1.GetResult() +28
O365_WebApp_MultiTenant.Controllers.<Index>d__0.MoveNext() in D:\Projekte\Office 365\O365-WebApp-MultiTenant-master\O365-WebApp-MultiTenant\O365-WebApp-MultiTenant\Controllers\ContactsController.cs:65
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +99
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult) +97
System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeAsynchronousActionMethod>b__36(IAsyncResult asyncResult) +17
System.Web.Mvc.Async.WrappedAsyncResult1.CallEndDelegate(IAsyncResult asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +32
System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +50
System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +225
System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResult1.CallEndDelegate(IAsyncResult asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +34
System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +26
System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +100
System.Web.Mvc.Async.WrappedAsyncResult1.CallEndDelegate(IAsyncResult asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27
System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +13
System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) +29
System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +36
System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) +12
System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) +22
System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +26
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +21
System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) +29
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +28
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult 结果) +9
System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +129