Aspose.Tasks.TasksReadingException while using MspDbSettings with Project Server 2016

Hi Team,
As mentioned in the thread, Aspose.Tasks.TasksReadingException while using MspDbSettings, now am trying to use MspDbSettings to read project from Project Server 2016 Enterprise version.

While executing like 2 from below :
(1) MspDbSettings oMsPDbSet = new MspDbSettings(“SQLConnectionString”, new Guid(“actualID”));
(2) Project oProjMppSrv = new Project(oMsPDbSet);
Getting an exception : “Project reading exception.” from Aspose.Task.

Please refer below for more details on exception

**InnerException {“Project reading exception.”} **
System.Exception {Aspose.Tasks.TasksReadingException}
LogText “Reading common project data started.\r\n”
Message “Project reading exception.”
Operation “Reading common project data”
Source “Aspose.Tasks”
StackTrace " at \b ​ .\u0005 ()\r\n at \b ​ .\u0002(Project \u0002)\r\n at Aspose.Tasks.Project…ctor(DbSettings settings)\r\n

Am using Aspose.Task version 18.6, do let me know whether for Project Server 2016 I should be using different approach.

@Rajeshrv,

Please share your specific project file with us that you are trying to access from database.

Hi,
I have attached the file SDP_AsponseDllFetch.zip (73.3 KB), which am trying to read from MPP Project Server 2016.

Thank you.

@Rajeshrv,

Could you please give it a try with the latest version of Aspose.Tasks for .NET 18.7.1 that we have just released? Meanwhile, we are trying to establish test environment for investigating the issue at our end.

@kashif.iqbal
I re-tried with 18.7.1 today morning, and it was showing the same error. Below is the complete stack trace for your reference.

Note: This error is coming up for any MPP file, you can even just create a simple project in Project Server 2016 and try reading, same error shows up.

Aspose.Tasks.TasksReadingException: Project reading exception. —> Aspose.Tasks.TasksReadingException: Project reading exception. —> System.Data.SqlClient.SqlException: Invalid object name ‘pub.MSP_PROJECTS’.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.ExecuteReader() at ? .(String , ) at ?? .() at ?? . ? () --- End of inner exception stack trace --- at ?? . ? () at ? . () --- End of inner exception stack trace --- at ? . () at ? .(Project ) at Aspose.Tasks.Project..ctor(DbSettings settings) at CheckAsponseMPP.Program.<>c__DisplayClass1_0.<ReadMPPFromServer16>b__0(String itemGUID) in C:\Rajeshrv\SampleProjects\CheckAsponseMPP\CheckAsponseMPP\Program.cs:line 222 at System.Collections.Generic.List1.ForEach(Action`1 action)

@kashif.iqbal
After analyzing the error message, am able to pull project from Project 2016 by setting Schema property for MspDbSettings object.

I hope this could be updated in the documentation or in your sample code.

Thank you.

@Rajeshrv,

Thank you for sharing feedback. Could you please be kind enough to suggest the change for inclusion in documentation? We’ll make it part of the article for future reference.

In the link Creating, Reading and Saving Projects
Under the topic “Importing Project Data From Microsoft Project Database”

Current :

MspDbSettings settings = new MspDbSettings(sqlConnectionString.ConnectionString, new Guid("E6426C44-D6CB-4B9C-AF16-48910ACE0F54"));
Project project = new Project(settings); 

Suggestion:

MspDbSettings settings = new MspDbSettings(sqlConnectionString.ConnectionString, new Guid("E6426C44-D6CB-4B9C-AF16-48910ACE0F54"));
// settings.Schema = "dbo"; //Need to specify the Schema value if the default Database schema is different from "dbo".
Project project = new Project(settings); 

@kashif.iqbal, hope these details would help.
Thank you.

@Rajeshrv,

Thank you for your suggestions. We will look into it and proceed accordingly.