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

Free Support Forum - aspose.com

MPP File Loading Exception

Aspose.Tasks for .NET 8.9.0, .NET Framework 2.0 application, Visual Studio 2010. Running the following code with the attached MPP file throws an exception: “An item with the same key has already been added.” Can you please let me know why?

Project project = new Project(@“IT-Project-Plan-Example.mpp”);


at . ​ (Project , Stream )

at .(Stream )

at Aspose.Tasks.Project.(Stream , ParseErrorCallback )

at Aspose.Tasks.Project…ctor(String template, ParseErrorCallback parseErrorHandler)

at Aspose.Tasks.Project…ctor(String template)

at TestAsposeTasks.Form1.button1_Click(Object sender, EventArgs e) in C:\Users\Administrator\Documents\Visual Studio 2010\Projects\TestAsposeTasks\Form1.cs:line 26

at System.Windows.Forms.Control.OnClick(EventArgs e)

at System.Windows.Forms.Button.OnClick(EventArgs e)

at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)

at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ButtonBase.WndProc(Message& m)

at System.Windows.Forms.Button.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)

at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)

at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)

at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)

at System.Windows.Forms.Application.Run(Form mainForm)

at TestAsposeTasks.Program.Main() in C:\Users\Administrator\Documents\Visual Studio 2010\Projects\TestAsposeTasks\Program.cs:line 17

at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)

at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)

at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()

at System.Threading.ThreadHelper.ThreadStart_Context(Object state)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

at System.Threading.ThreadHelper.ThreadStart()

InnerException: System.ArgumentException

Message=An item with the same key has already been added.



at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)

at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) <br /> at System.Collections.Generic.Dictionary2.Add(TKey key, TValue value)

at ​ …ctor(Stream , Stream )

at ​ …ctor(Stream , Stream , Boolean )

at ​ .()

at ​ .()

at ​ .( )

at . ()

at . ()

at . ()

at . ​ (Project , Stream )


Hi Steve,

Thank you for writing to Aspose support team.

We have verified the exception while loading the sample MPP file with the latest version of Aspose.Tasks for .NET and have logged it as TASKS-34329 in our bug tracking system. Our development team will investigate the issue further. Usually, issues are fixed in the upcoming release of the API, however, it may take extra time if there is some complexity involved. In any case, we’ll update you here once there is some information available about this issue.

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

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.