Doc.Save .NET 2.0 vs. 3.5

Using the help document is shows to use doc.Save and it will convert the response into a stream. This method works in the .NET 2.0 DLL but it not there in .NET 3.5.

.NET 2.0

doc.Save(Response, “PersonalizedLetter Out.doc”, ContentDisposition.Inline, null);

.NET 3.5: I had to end up using…

Document doc = new Document(System.IO.Path.Combine(DocPath, DocName));

MemoryStream stream = new MemoryStream();
doc.Save(stream, SaveFormat.Doc);
Response.Clear();
Response.ContentType = "application/word";
Response.AddHeader("content-disposition", "inline; filename=out.doc");

byte[] bytes = stream.GetBuffer();
Response.BinaryWrite(bytes);
Response.End();

Is this the pattern to follow with .NET 3.5?

If you release a .NET 4.0 DLL will it return to the former 2.0 way of working?

Hello

Thanks for your request. Please note System.Web is not available in the .NET Framework 3.5/4.0. ASP.NET applications work under .NET 1.1 or .NET 2.0. To make sure, please check IIS settings. As you can see you can select only .NET 1.1 or .NET 2.0 . This is entirely by design.

In your case, you should use Aspose.Words for .NET 2.0 in your ASP net application.
https://downloads.aspose.com/words/net

Best regards,