Free Support Forum -

Can't open .MPD projects containing resources


I’m having a problem with Aspose.Project v1.3.2.0. When opening a project containing resources in a .MPD file using the ReadMPDProject method, an exception is thrown with the following information:

Error reading resource from a database

System.InvalidCastException: Specified cast is not valid.
at System.Data.OleDb.OleDbDataReader.GetBytes(Int32 ordinal, Int64 dataIndex, Byte[] buffer, Int32 bufferIndex, Int32 length)
at Aspose.Project.MPDProject.a(Hashtable A_0)

at Aspose.Project.MPDProject.a(Hashtable A_0)
at Aspose.Project.MPDProject.k()
at Aspose.Project.MPDProject…ctor(OleDbConnection conn, MPDProjectInfo pinfo, Boolean use_decimals, String connect_str)
at Aspose.Project.MPDDatabase.ReadMPDProject(MPDProjectInfo pinfo)
at AsposeProjectTest.Form1.Form1_Load(Object sender, EventArgs e) in c:\documents and settings\eklo\my documents\visual studio projects\AsposeProjectTest\form1.cs:line 106

Even the sample at fails when using a simple project containing just a single task and a single resource. If I delete the resource, the project is read without any problems.

Any solution for this?

Dear Eklo,

Thank you. I will check it and probably publish new hot fix.
Just a small question. What database you use? MS SQL Server or MPD?

I’m using .MPD files created with MS Project 2003 Professional SP1.

Dear Eklo,

Please check new 1.3.3 hot fix.
MPD database sometimes has empty resource records.
Now 1.3.3 will skip it.

Thanks for your help, but unfortunately the 1.3.3 hotfix doesn’t seem to fix my problem. ReadMPDProject still fails with the same error on both existing and new MPD projects with resources.

Dear Eklo,

Please, could you send me such mpd project for testing?