Class ProjectOnlineException

ProjectOnlineException class

Represents an exception which is thrown when errors are found during interaction with Project Online or Project Server instance.

public class ProjectOnlineException : TasksException

Examples

Shows how to catch exception while reading a project from MS Project Online.

try
{
    const string URL = "https://project_server.local/sites/pwa";
    const string Domain = "CONTOSO.COM";
    const string UserName = "Administrator";
    const string Password = "MyPassword";

    var project = new Project(DataDir + @"Project1.mpp");

    var windowsCredentials = new NetworkCredential(UserName, Password, Domain);
    var projectServerCredentials = new ProjectServerCredentials(URL, windowsCredentials);
    var manager = new ProjectServerManager(projectServerCredentials);
    manager.CreateNewProject(project);
}
catch (ProjectOnlineException ex)
{
    Console.WriteLine(ex.Message);
}

See Also