我们正在使用Azure Graph API客户端库版本2.1.1.0。我们的应用程序尝试在登录时验证用户角色。在做这个广告客户端时。以下电话似乎是抛出异常。在这方面的任何帮助都非常感谢。
呼叫:
adClient.Users
.Expand(_ => _.MemberOf)
.Where(_ => _.ObjectId == objectId)
.ExecuteAsync()
.Result;
adClient.DirectoryRoles
.Expand(_ => _.Members)
.ExecuteAsync()
.Result;.
异常详细信息: ---> (内部异常#0)System.InvalidOperationException:上下文已经在跟踪具有相同资源Uri的不同实体。 在System.Data.Services.Client.EntityTracker.InternalAttachEntityDescriptor(EntityDescriptor entityDescriptorFromMaterializer,Boolean failIfDuplicated) 在System.Data.Services.Client.AtomMaterializerLog.ApplyToContext() 在System.Data.Services.Client.MaterializeAtom.MoveNextInternal() 在System.Data.Services.Client.MaterializeAtom.MoveNext() 在System.Linq.Enumerable.d__941.MoveNext() 在System.Collections.Generic.List1..ctor(IEnumerable1集合) 在System.Linq.Enumerable.ToList [TSource](IEnumerable1 source) 在Microsoft.Azure.ActiveDirectory.GraphClient.Extensions.PagedCollection2..ctor(DataServiceContextWrapper context,QueryOperationResponse1 qor) 在Microsoft.Azure.ActiveDirectory.GraphClient.Extensions.DataServiceContextWrapper。<> c__DisplayClass4c2.b__4a(IAsyncResult r) 在System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar,Func2 endFunction,Action1 endAction,Task1 promise,Boolean requiresSynchronization) ---从抛出异常的先前位置开始的堆栈跟踪结束--- 在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务) 在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务) 在Microsoft.Azure.ActiveDirectory.GraphClient.Extensions.DataServiceContextWrapper.d__4e2.MoveNext() ---从抛出异常的先前位置开始的堆栈跟踪结束--- 在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务) 在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务) 在Microsoft.Azure.ActiveDirectory.GraphClient.Extensions.ReadOnlyQueryableSet2。< b__0> d__2.MoveNext()< ---