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
  • Hello Jesse

    I had tried that already, i.e. the Task<GroupShareClient> and var. The declaration is then fine, but it would then fail from the line

    var actualProject = await groupShareClient.Project.Get(id);
    DateTime completedDate = Convert.ToDateTime(actualProject.CompletedAt);

    Here, I am trying to get the CompletedDate of a particular project, which cannot be done with the Studio Project API, therefore I need to use one call from the GroupShare API.

    private async Task<bool> ProjectExpired(ServerProjectInfo project)
    {
    GroupShareClient groupShareClient = await GroupShareClient.AuthenticateClient("sa", "sa",
    new Uri("http://server2012"), GroupShareClient.AllScopes);

    string id = project.ProjectId.ToString();
    var actualProject = await groupShareClient.Project.Get(id);
    DateTime completedDate = Convert.ToDateTime(actualProject.CompletedAt);

    if (completedDate.AddDays(Convert.ToInt32(settings.settingArchiveDuration)) < DateTime.Now)
    return true;
    else
    return false;
    }
Children