0

I am trying to add the Security Group(child) to another Security Group(parent) using the GraphClient in a console application

var childdirectoryObject = new DirectoryObject
{
Id = groupName.Id
};
var targetGroupCollection = Task.Run(async () => await graphClient.Groups[parentGroupid].Members.References.Request().AddAsync(childdirectoryObject)).Status;
Task.WaitAll();
Console.WriteLine(targetGroupCollection);

But I am getting WaitingForActivation as an output. Can anyone help me on this

TARUN
  • 241
  • 1
  • 8
  • 27

1 Answers1

0

this sounds like not so much a graph issue, but rather a c# threading question: I'm not super well versed in c# threading. but here is a thread with people discussing something very similar. Task.WaitAll keeps in loop

this sounds like whats happening to you, either your tasks are not starting or you're stuck in a deadlock.

Hope that helps, Regards,

alphaz18
  • 2,610
  • 1
  • 5
  • 5
  • Yes, the issue lies with System.Threading.Tasks that you're using and not with Graph API!! – Dev May 12 '20 at 18:16