Free Support Forum - aspose.com

Reading Sub projects from MS Project Server


#1

Am trying to read a project from Microsoft Project Server 2016, which has a sub project.

Loading the project as mentioned in
https://docs.aspose.com/display/tasksnet/Creating%2C+Reading+and+Saving+Projects#Creating,ReadingandSavingProjects-ImportingProjectDataFromMicrosoftProjectDatabase

While reading the sub project task, Tsk.IsSubproject is coming as false and also has zero children.
Can you please confirm whether reading Projects with Subprojects from MS Project server is supported.

To reproduce the issue, please create two projects in the Server and make one as SubProject of other and try to read the project details from server.

Thank you,
RajeshKumar R.V.


#2

@Rajeshrv

While reading the sub project task, Tsk.IsSubproject shall be false for the tasks of sub-project but for the task where the sub-project is inserted it shall be true.
For more clarification, please run this code sample for your project:

Project prj = new Project(settings);

// Create a ChildTasksCollector instance
ChildTasksCollector collector = new ChildTasksCollector();

// Collect all the tasks from RootTask using TaskUtils
TaskUtils.Apply(prj.RootTask, collector, 0);

// Parse through all the collected tasks
foreach (Task tsk in collector.Tasks)
{
    Console.WriteLine("Task Id: {0}", tsk.Get(Tsk.Id));
    Console.WriteLine("Task Uid: {0}", tsk.Get(Tsk.Uid));
    Console.WriteLine("Task Name: {0}", tsk.Get(Tsk.Name));
    Console.WriteLine("Is Subproject: {0}", tsk.Get(Tsk.IsSubproject));
    Console.WriteLine("Task Start: {0}", tsk.Get(Tsk.Start));
    Console.WriteLine("Task Finish: {0}", tsk.Get(Tsk.Finish));
}

#3

Thanks for your reply.

The above solution is working if I try to read MPP project using MPP file, but if I try to read the project from Project Server 2016 I was able to read the subproject as Task, but that tasks fetches zero children. More over the flag IsSubProject on that task reads as false. This behavior is not specific to a project file from Project Server, if I try to read any project with type 6 (MasterProject) am having similar behavior.


#4

@Rajeshrv

Thank you for your feedback.
We have logged this issue with ID “TASKSNET-2732” for further investigation. You will automatically be informed here once we have more information to share.


#5

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

Thank you.


#6

@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.


#7

The issues you have found earlier (filed as TASKSNET-2732) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan


#8

Hi Team,
I was just trying to using this version 18.12 and when i try to read project using below code :

SqlConnectionStringBuilder sqlConnectionString = new SqlConnectionStringBuilder
{
DataSource = oSelDataCon.DbDataSource,
Encrypt = true,
TrustServerCertificate = true,
InitialCatalog = oSelDataCon.DbInitialCatalog,
NetworkLibrary = “DBMSSOCN”,
UserID = oSelDataCon.DbUsername,
Password = oSelDataCon.DbPassword
};
MspDbSettings oMsPDbSet = new MspDbSettings(sqlConnectionString.ConnectionString, new Guid(sCurrentMppProjId))
{
Schema = oSelDataCon.DbSchema
};
return new Project(oMsPDbSet);//Throws error here.

Throwing this error “Unable to cast object of type ‘System.Guid’ to type ‘System.String’.”
But if I switch back to 18.6 version things are fine.


#9

@Rajeshrv

Thank you for writing back to us.
We have logged this issue with ID “TASKSNET-2898” for further investigation. You will automatically be informed here once we have more information to share.


#10

@MuzammilKhan
Can you confirm when I can get this fix, we need to plan for our release accordingly.

Thank you.


#11

@Rajeshrv

Thank you for writing back to us.

This issue has been resolved and will be a part of our next API release i.e. Aspose.Tasks for .NET 19.1.


#12

@MuzammilKhan
Thanks for the update, please do confirm when could we expect the same.
Also do let me know if I could try any pre-release version of this some how.


#13

@Rajeshrv

Thank you for writing back to us. Aspose.Tasks for .NET 19.1 shall probably be available at the end of next week.


#14

The issues you have found earlier (filed as TASKSNET-2898) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan


#15

Team,
Currently am checking the subjected behavior with 19.1/19.2 dll, and am seeing two different problems

Code :
SqlConnectionStringBuilder sqlConnectionString = new SqlConnectionStringBuilder
{
DataSource = oSelDataCon.DbDataSource,
Encrypt = true,
TrustServerCertificate = true,
InitialCatalog = oSelDataCon.DbInitialCatalog,
NetworkLibrary = “DBMSSOCN”,
UserID = oSelDataCon.DbUsername,
Password = oSelDataCon.DbPassword
};
MspDbSettings oMsPDbSet = new MspDbSettings(sqlConnectionString.ConnectionString, new Guid(sCurrentMppProjId))
{
Schema = oSelDataCon.DbSchema
};
return new Project(oMsPDbSet);//Throws error here.

  1. Throwing this error “System.ArgumentException: ‘An item with the same key has already been added.’"
  2. .Resources.GetByUid(iRscUid).Assignments ==> gives no assignment details its just empty.

Could you please check these issues.


#16

@Rajeshrv

Thank you for your feedback.

We have logged this issue with ID “TASKSNET-3024” for further investigation. You will automatically be informed here once we have more information to share.