Free Support Forum -

SOS: Upgrading from Aspose.Word 1.9.3 to 2.2.3 broke my code


I upgraded the component just now from 1.9.3 to 2.2.3...Now I get an error trying to view the code , which worked fine before the upgrade is as follow:

byte[] content = (byte[]) ds.Tables[0].Rows[0][DocumentAssemblyUtils.COL_CONTENT];

Response.ContentType = "application/";

Response.Charset = "";

Aspose.Word.Word wd2 = new Word();
MemoryStream ms2 = new System.IO.MemoryStream();
Aspose.Word.Document doc = wd2.Open(ms2);

doc.Save(templateFileName, SaveFormat.FormatDocument, SaveType.OpenInBrowser, this.Response) ;

On the line: Aspose.Word.Document doc = wd2.Open(ms2); I get the error: "Cannot access a closed Stream. "

Simply set ms2.Position to 0 before that line.