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

Free Support Forum - aspose.com

Can't read MS Project by Stream, "Specified method is not supported"

We’ve started getting an error when reading MS Project by Stream.

Specified method is not supported.
at System.Net.Http.HttpBaseStream.Seek(Int64 offset, SeekOrigin origin)
at #=zKc$_JwDcs4cK72jobP8=.#=zTyBdeWk=(Stream #=zUG$kowQ=, Encoding #=zsfE8=)
at Aspose.Tasks.Project.#=zK$Llf9RE(Stream #=zUG$kowQ=, LoadOptions #=z9vKWl4wC)
at Aspose.Tasks.Project…ctor(Stream stream)
at Services.External.MSProjectReader.ReadFile(Stream stream) in MSProjectReader.cs:line 115

    private List<MSProjectTask> ReadFile(Stream stream)

        Project project = new Project(stream); // Line 115

        return this.ParseFile(project);

Version 22.7.0

This has worked fine until recently, at version 22.6.0 - We updated to 22.7.0 in hopes there was a bug fix…

Any ideas? Thanks!

Project(Stream) constructor expects seekable Stream. According to stack trace, you’ve provided HttpBaseStream which doesn’t support seeking.
To avoid the error you can copy the stream’s content to MemoryStream and pass it to Project(Stream) ctor.

This behavior is quite old. For example, it can be reproduced in v. 19.1.