Azure Active Directory Graph Client 2.0 - Context is not currently tracking the entity

前端 未结 3 1207
醉酒成梦
醉酒成梦 2020-12-20 04:01

I have recently installed the Azure Active Directory Graph Client Library 2.0.2 Nuget package and am unable to add Members to Groups both adding a group to a group or adding

3条回答
  •  清歌不尽
    2020-12-20 04:27

    I tried this new syntax but still does not work.

     public async Task> addUserToAzureGroup(Group AzGroup, User AzUser)
     {
         // link the found user with the found group
         try
         {
             AzGroup.Members.Add(AzUser as DirectoryObject);
             await AzGroup.UpdateAsync();
         }
         catch (Exception ex)
         {
             Exception myEx = new Exception(ex.Message);
             retResult.Exception = myEx;
             return retResult;
         }
         return retResult;
     }
    

    I have almost the same error text in the execption message: The context is already tracking the relationship

    Any news on that issue? Could anyone guess why that happens?

    I also tried from the manage.windowsAzure.com UI and still cannot add the user! I get this error: Could not add members to group 'myAzAD_group'.

提交回复
热议问题