Aspose.Task to save project into Project Server (C# .NET)

Hello Team,
Currently am trying to save a project created in local machine to into Project Server 2013/2016. I couldn’t find any documentation/sample to do the same.

Can you please share me some pointers for handling the same with Aspose.Tasks.

Thank you.

@Rajeshrv,

Can you please confirm to us if you want the converse of this? Creating, Reading and Saving Projects

If so, this is not supported at present. We’ll look into it at our end for possible implementation once you confirm you require the converse of this feature.

@kashif.iqbal
Yes, am in need of converse of “Importing Project Data From Microsoft Project Database”, so that I could create new projects from local into project server through code.

Thank you.

@Rajeshrv,

We have logged your requirement as TASKSNET-2567 for further consideration at our end. We will update you here once there is some information or a fix version available in this regard.

Team, can you please confirm on TASKNET-2567, so that we could plan our features for next release accordingly.

Thank you.

@Rajeshrv

Thank you for writing back to us.
We are working on this issue and it shall be a part of Aspose.Task for .NET 19.1 which shall be available in Jan 19.

@MuzammilKhan
Now I have Aspose Task .Net 19.1, can you please point me some documentation/sample with which I could save the project file into Project Server.

Thank you.

@Rajeshrv

Thank you for writing back to us.

We regret to inform you that the required feature is not included yet. It is planned to be developed for version 19.3 now.

Team,
Can you confirm, whether this support is now included with 19.3

Thank you.

@Rajeshrv,

I have verified from our issue tracking system and like to share that issue is tentatively will be resolved in upcoming Aspose.Tasks 19.5. We will share the information with you as soon as the issue will be fixed.

Team,
Was there any update on this I see, that 19.5 is out.

Thank you.

@Rajeshrv,

I have verified from our issue tracking system and like to share that the issue is likely to get tentatively resolved in Aspose.Tasks for .NET 19.8. We request for your patience till the time the feature gets available in API.

Team,
I see that 19.8 is out now, could you confirm whether this issue is fixed. So that we can decide the version to use on our side.

Thank you.

@Rajeshrv,

I like to inform that due to more priority issues this issue will be resolved in Aspose.Tasks 19.10.

Team,
Please confirm whether this issue is addressed now.

Thank you.

@Rajeshrv,

I have verified from our issue tracking system and like to share that issue is likely going to be fixed in upcoming Aspose.Tasks for .NET 20.1. We request for your patience till the time the issue gets resolved.

Team,
Please confirm whether this issue is addressed with version 20.1.

Thank you.

Hello! Unfortunately, the issue is still under development. But it is in the final stage, we need to fix several issues with project saving before the release.

Estimated release version is Aspose.Tasks for .NET 20.2 which will be released in the first decade of February 2020.

The issues you have found earlier (filed as TASKSNET-2567) have been fixed in this update.

Hello Team,
I tried to do save operation in the project server using the sample provided here.

private static void SaveProjectToServerAspose(string sPath)
        {
            //Scenario 1
            var windowsCredentials = new NetworkCredential(USERNAME, PASSWORD, DOMAIN);
            var credentials = new ProjectServerCredentials("http://MSSERV16/sites/PWA", windowsCredentials);
            ProjectServerManager manager = new ProjectServerManager(credentials);
            var project = new Project(@"Sample1.mpp");
            manager.CreateNewProject(project);
            //Scenario 2
            windowsCredentials = new NetworkCredential(USERNAME, PASSWORD, DOMAIN);
            credentials = new ProjectServerCredentials("http://MSSERV16/sites/PWA", windowsCredentials);
            manager = new ProjectServerManager(credentials);
            project = new Project(@"Sample2.mpp");
            manager.CreateNewProject(project);            
            //Scenario 3            
            credentials = new ProjectServerCredentials("http://MSSERV16/sites/PWA", USERNAMEREADER, USEREADERPASSWORD);
            manager = new ProjectServerManager(credentials);
            project = new Project(@"Sample1.mpp");
            manager.CreateNewProject(project);
        }

For the mentioned three scenarios am getting different exceptions.
Scenario 1:
Aspose.Tasks.ProjectOnlineException
HResult=0x80131600
Message=Cannot connect to the Project Online. See inner exception for more details.
Source=Aspose.Tasks
StackTrace:
at #=zuF8ehdzVUJ4G8xlzM3tF5Zo2lGSaphfF3g==.#=z5FYbijI8gNOL(String #=zZFAqDlQ=, String #=zMEgpLoE=, String #=zexqCTFw=)
at #=zXyabF7CoNzVz6lVErx1WUsnW$jCsqnIct$ytnHc=.#=zDSbkA8X4p2RF(Boolean #=zgclonkU=, Boolean #=z3H4UBRI=, String #=zQkoQ_dsZOK3w)
at #=z6zZu2JkyT55GrZ9H5fBlY8tnEzqOHvuCjQu0Iti0t23w.#=zZBxRvmQ=(Project #=znsUTsbo=, ProjectServerSaveOptions #=zWgDWmdg3dgl5, Boolean #=zgclonkU=)
at Aspose.Tasks.ProjectServerManager.CreateNewProject(Project project, ProjectServerSaveOptions saveOptions)
at Aspose.Tasks.ProjectServerManager.CreateNewProject(Project project)

This exception was originally thrown at this call stack:
System.Net.HttpWebRequest.GetResponse()
#=zE46bfZmvpKnijLiYY0AAbKocGHyoEBSZIKMeH$s=.#=zQSIlulU=(System.Net.HttpWebRequest)
#=zuF8ehdzVUJ4G8xlzM3tF5Zo2lGSaphfF3g==.#=z5FYbijI8gNOL(string, string, string)

Inner Exception 1:
WebException: The remote server returned an error: (500) Internal Server Error.

Scenario 2:
System.ArgumentException
HResult=0x80070057
Message=project’s calendar guid should be set to non-empty value.
Source=Aspose.Tasks
StackTrace:
at #=zMR24he8ySJEObbI36QfmsTpnd723$4RminbtMB3Hp$XyT2JDEg==.#=za448GVAl1mwg(Project #=znsUTsbo=, List1 #=zawDCs54=) at #=zf_T$Y76Xd4sI$QzVEZVKYfClkXTr0HmcS4R7_UkXD$6iHTTJmg==.#=z6agrBO9Ts4O5(List1 #=zawDCs54=, Project #=zHCiGwwyy9zdo)
at #=zSx8TnyhXMgVX1KTWOqlWEzLEctBwEUi$tT_xuXZpnKm8Pznk$x6YO8I=.#=zqCBUx0wuhF46(#=zOtGIpuE= #=zHCiGwwyy9zdo, List`1 #=zawDCs54=)
at #=zzVS8yBtsdwvqMS5_nJYXPTCK1JJ9REmSQZVmK65qYIDG.#=zjMGIYHEKWAPQ(Project #=znsUTsbo=, MemoryStream #=zX3IrgNE=)
at #=z6zZu2JkyT55GrZ9H5fBlY8tnEzqOHvuCjQu0Iti0t23w.#=zZBxRvmQ=(Project #=znsUTsbo=, ProjectServerSaveOptions #=zWgDWmdg3dgl5, Boolean #=zgclonkU=)
at Aspose.Tasks.ProjectServerManager.CreateNewProject(Project project, ProjectServerSaveOptions saveOptions)
at Aspose.Tasks.ProjectServerManager.CreateNewProject(Project project)

Scenario 3:
Aspose.Tasks.ProjectOnlineException
HResult=0x80131600
Message=Failed to retrieve auth token. Unexpected structure of security token response.
Source=Aspose.Tasks
StackTrace:
at #=zuF8ehdzVUJ4G8xlzM3tF5Zo2lGSaphfF3g==.#=zBpjhsDYzDSF9(Stream #=zyeWM52vUIqUG)
at #=zuF8ehdzVUJ4G8xlzM3tF5Zo2lGSaphfF3g==.#=z$JAO8dFdp6ig(String #=zW5sYzFifgNVRmhGyhbj4r_4=, String #=zKZMO7WQ=, String #=zuM6vyp0=)
at #=zuF8ehdzVUJ4G8xlzM3tF5Zo2lGSaphfF3g==…ctor(ProjectServerCredentials #=zR6G82ts=, #=zvuCj04bqpFeJ7ROPH3tvYXZHiLmXI9hR5uOoOvE= #=zmgRd36kAz1uC)
at #=zuF8ehdzVUJ4G8xlzM3tF5Zo2lGSaphfF3g==…ctor(ProjectServerCredentials #=zR6G82ts=)
at Aspose.Tasks.ProjectServerManager…ctor(ProjectServerCredentials credentials)

For Scenario 1 & 2 I tried to use domain login credentials with two different mpp files which was created locally using Aspose.Task, when trying to upload the files the exceptions were coming up.
For Scenario 3, I am trying to use the user which was specifically created in MPP Server 2016 for performing project read/create operations, for which I was getting security token exception.

Can you please cross check these behavior and direct me on how to proceed using this feature.

Sample project files attached here.

Thank you.