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

Free Support Forum - aspose.com

MS Project 2016 - An attempt was made to move the position before the beginning of the stream

We use Aspose.Tasks 19.8.0.0 and it looks like you can no longer import MS Project 2016 files. Using “new Aspose.Tasks.Project(file)” on a recent 2016 file we get the following error:

System.IO.IOException
HResult=0x80131620
Message=An attempt was made to move the position before the beginning of the stream.
Source=mscorlib
StackTrace:
at System.IO.MemoryStream.Seek(Int64 offset, SeekOrigin loc)
at #=zY6NlXxDOfLrbA2ORm$u6WtLHsUx1uEjJQTQbfbg=.#=zXTIQ_9jjnmHU()
at #=zY6NlXxDOfLrbA2ORm$u6WtLHsUx1uEjJQTQbfbg=.#=zbvL_B6BEAm4N()
at #=zLQiq8TcaARLVEGhW1NjzGTZIBvBILDx_fw==.#=z_UGqDx0edzfx()
at #=zqrl6So0zKQKBMbIS7aI11tB_7n7MaxgMy1AbpeY=.#=zpbK3O1M=()
at #=z$Lb_vf8tw$fNlc3hJLAE1KKkZjZ0fw6tTQ==.#=zlv9y8Q0=()
at #=z$Lb_vf8tw$fNlc3hJLAE1KKkZjZ0fw6tTQ==.#=zlv9y8Q0=(Project #=znVXrWkE=, Stream #=zGgQIVvU=)
at #=z9LChlvQrb9cb6YjwWMpj$n8=.#=zlv9y8Q0=(Stream #=zGgQIVvU=, Project #=znVXrWkE=)
at Aspose.Tasks.Project.#=zRdFoNccAV45g(Stream #=zGgQIVvU=, ParseErrorCallback #=zspoLLFQl6EFf, Encoding #=z03j1CP0=, PrimaveraXmlReadingOptions #=zuJxr0gI=)
at Aspose.Tasks.Project…ctor(Stream stream)
at…

We believe this used to work.

@tpml,
according to information provided I’ve created a .MPP file in MSP 2016 and have tried to open it using Aspose.Tasks for .NET v. 19.8 and ctor Project(string):

var project = new Project(“New project 2016.mpp”);

The example has run successfully, without exceptions.

Thanks. I’ve attached the recently created 2016 mpp file that fails for us - if that helps to reproduce.2016 project.zip (25.9 KB). The file is read in as an input stream. We tried the latest version of Aspose.Tasks and the same file imported fine.

@tpml,
thank you for the sample.

According to the file it has been saved in version 16.0.15128.20178 of MS Project.
I would guess it corresponds to MS Project 2021.

Internal format of MPP file was changed in this version (it happens in some updates of MS Project).
v. 19.8 was not able to handle this case. The issue was fixed in 21.8.

Thanks for your help. We’ll look to upgrade. (The file was saved in MSP 2016 but it had had the latest office updates applied. The same problem occurs for an updated 2019 too).