We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Import error

Hello,

I am receiveing hte following error when attempting to import a .mpp file from MS project 2013 into our software.

Error saving file C:\Test Upload.mppAspose.Tasks.TasksReadingException: Project reading exception. ---> System.ArgumentException: Item has already been added. Key in dictionary: '0' Key being added: '0' at System.Collections.SortedList.Add(Object key, Object value) at (Object , Object , Object ) at ..() at ...ctor(Stream , Stream , Stream , Stream , Int32 , Int32 ) at ..(Project , Stream ) --- End of inner exception stack trace --- at ..(Project , Stream ) at Aspose.Tasks.ProjectReader.Read(Stream stream) at Aspose.Tasks.ProjectReader.Read(String filename) at projectUpload.btnSubmit_Click(Object sender, EventArgs e) in C:\ds\OakTree\Cadence\Cadence_Export\Cadence_Export\WebSite\ProjectMasterWeb\projectUpload.aspx.vb:line 76

I am assuming that it is a conflict between MSP2013 and ASPOSE, but I'm not sure. Any help here would be apprecitated.

Kevin

Hi Kevin,


We are sorry for any inconvenience caused to you.

Could you please provide us the sample MPP file that gives error when imported using Aspose.Tasks API? We’ll investigate it further and assist you further in this regard.

PS: I would request you to please use the latest version of Aspose.Tasks for .NET 5.4.0 in your applications to see if the problem still exists.

Hello Kashif,

Thanks for the quick response. Please see the attached mpp file per your request.

Keivn

Hi Kevin,


Thank you for providing the support material.

I have tested this issue at my end with the latest version of Aspose.Tasks for .NET 5.4.0 and, unfortunately, I could not reproduce it at my end with the following lines of code. Could you please share your sample application with us so as we can reproduce this issue at our end and assist you further?

Project project = new Project(“Test
Upload.mpp”
);<o:p></o:p>


I have set up an account for you at

https://cadenceprojectmaster.com/login.aspxv

username kevin.murphy05@gmail.com

password is asposetest1

to test the import please click on the project "test one" on the dashboard

on the right hand side click on "import from MS Project"

click browse and locate the mpp file that I have already sent to you (also attached here)

click import

You should then see the error.

If you have any problems you may acll me at 503.223.3623

Thanks

Kevin

Hi Kevin,


Thanks for providing more information.

I have tried to open this link but getting following error:

"404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable."

It seems that this mechanism may not be that helpful to identify the issue. Could you please send some standalone application which can be used to re-produce this issue? It will help us to analyze your code and provide assistance as soon as possible.

Thanks for your cooperation and patience.

Sorry. Try this link

https://cadenceprojectmaster.com/login.aspx

Hi Kevin,


Thank you for providing the link.

With your test file, I was able to observe the issue at my end. But unfortunately, with the latest version of Aspose.Tasks for .NET 5.4.0, I am unable to reproduce the TaskReadingException while loading the file. Can you please confirm to us if you are using the latest version of Aspose.Tasks as I have mentioned? If so, I would request you to please provide us a standalone sample application that can be used to reproduce the issue at our end for reporting to the development team (as this is a must step before we report any bug/issue). I appreciate your cooperation in this regard.

Hello Kashif,

I had our outsouced vendor check the license and version. I am sorry but it lookslike we have the .total liscense version 2.2 not the .tasks license.

Again I am sorry for putting you through this, but can you advise me as to what my next steps shoud be?

Hi Kevin,


No problem.

If your subscription is still valid, you can download the latest build of Aspose.Total and test your application with it. It contains the latest builds of all the products and your issue can be verified with it. If your license for Aspose.Total is expired, you may contact our Sales team for renewel by writing on Aspose.Purchase forum. Please let us know if we can be of any additional help in this regard.

Our ASPOSE license is currently valid. So if I understand what you are telling me, .total incorporates what .tasks does. If we update our version it should solve the issue?

Also, what is the current version of .Total?

Thanks

Kevin

Hi Kevin,


You may please get the latest version of Aspose.Total for .NET here. It contains Aspose.Tasks for .NET 5.4.0.

Hi,


I found this thread while googling for the same error. I have just upgraded to 5.4.0 but I still get the error. The file I am trying to read have been produced with 5.4.0 as well.

I can’t attach the file here - but I can email it to you?

Thanks in advance for your assistance
Christian

Update - it seems to be related to Ressources. I have a setting in my system to include ressources or not. The file failing has ressources included, but if I disable this (for the same input) I do not get the error.


The following sample code shows how I add Ressources:

if (resource == null) {

//Create new ressource

resource = new Resource(assignee.DisplayName)

{

EmailAddress = assignee.EmailAddress,

HyperlinkSubAddress = assignee.Name,

IsInactive = !assignee.Active

};

msproject.Resources.Add(resource);

Console.WriteLine("Added ressource " + assignee.DisplayName);

}

ResourceAssignment ass = new ResourceAssignment(task, resource); msproject.ResourceAssignments.Add(ass);

UPDATE: I have made the error disappear for this particular case by adding the following line (as second last line):

ass.Uid = msproject.ResourceAssignments.Count + 1;


I will continue to see if this fix covers all cases where I have seen this error.


Hi Kevin,

Please let us know when you are done with your testing. If the error still persists, I would request you to please create a sample console application that can be used at our end to reproduce this issue. We’ll look into it and assist you further.

Hello Kashif,

After installing the updated dlls that you provided the import issue is solved. I am now able to import the saved .mpp file from MSP2013 without any problems. I am, however, experiencing another issue that I hope you are able to help me with.

When I import a xml file from our project planning software it creates a xml file that MSP will import. Everything comes in nicely, but when you save the file, therefore creating an .mpp file, and then re-open the .mpp file all of the tasks are assigned to the last resource on the MSP resource sheet. All of the resources are listed on the resource sheet, but the filter on the Gnatt chart will only list the one resource.

I am completely stumped here. I am unable to recreate the problem with a file that is created in MSP2013, only files that come in from our planning software and imported into MSP. Any ideas?

Thanks

Kevin

Hi Kevin,


Thanks for writing to Aspose.Tasks support team again.

We may succeed in re-producing the issue using your application at https://cadenceprojectmaster.com/login.aspx, but it is not sufficient to identify the exact problem. We need to know the detail where Aspose.Tasks is used in your application so that actual issue is traced and rectified.

Therefore for detailed analysis, we would request you to please provide us the sample XML file along with the standalone console application which can be used to re-produce this issue. It will help us to provide you assistance in a better way.

Hello Kashif,

I've attached the xml file that was exported from our software. The xml file is easily imported into MSP2013, but if you save it to an mpp file, close MSP2013 then reopen the mpp file, the result is that all of the tasks are now assigned to the last person on the resource sheet. I'm not even sure that this is a .task issue, but I was hoping that you or one of your colleagues had seen something like this before.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks

Kevin

Hi Kevin,


I am really sorry for the inconvenience caused to you.

I am afraid to inform that this information is insufficient to investigate the issue as until and unless we don’t have the detail of code used to create this XML, we cannot identify the reason how this problematic XML is created. After knowing the detail of XML creation, we will be in a better position to analyze the issue further.

Could you please arrange some sample console application which can be independently used to create this XML file? Once we have this code, we will assist you further regarding the resources issue in the resultant MPP file in MSP 2013.