SDL GroupShare 2015 seemingly not working when used from command line application

When calling the following to authenticate against a GroupShare 2015 server all is fine as long as I use it from a Windows Forms app. But it fails when used as a command-line app. It just never reaches the MessageBox line. Is there a restriction when using this from a command-line app?

 

GroupShareClient groupShareClient;

groupShareClient = await GroupShareClient.AuthenticateClient("sa", "sa", new Uri("http://server2012"), GroupShareClient.AllScopes);

MessageBox.Show("connected");

Parents Reply Children
  • Hi Ziad

    When you call  groupShareClient.Result, that is the equivalent of calling the Wait() method so you do not need Wait.

    Also, you should not be using the "await" keyword!

    Please try it like the following (remove the last line that calls Wait):

    Task <GroupShareClient> groupShareClient = GroupShareClient.AuthenticateClient("sa", "sa",
    new Uri("http://server2012"), GroupShareClient.AllScopes);

    string id = project.ProjectId.ToString();

    var actualProject = groupShareClient.Result.Project.Get(id);

    DateTime completedDate = Convert.ToDateTime(actualProject.CompletedAt);

    emoji