I just upgraded my Aspose.Word component to 3.1.2.0 today and have a major problem occurring when I use the Document.Save method. All of my code worked perfectly with the previous version of the component… below is my error and stack trace:
Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks. Parameter name: ticks
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks. Parameter name: ticks
Source Error:
Line 56: string fnameRelative = tempdir + myGuid + “.doc”; Line 57: string fnameAbsolute = HttpContext.Current.Server.MapPath(fnameRelative); Line 58: myDoc.Save(fnameAbsolute, SaveFormat.FormatDocument); Line 59: return fnameRelative; Line 60: }
Source File: c:\inetpub\wwwroot\EIM\Documents\DocExporter.cs Line: 58
Stack Trace:
[ArgumentOutOfRangeException: Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks. Parameter name: ticks] System.DateTime…ctor(Int64 ticks) +101 System.CurrentSystemTimeZone.ToLocalTime(DateTime time) +49 System.DateTime.ToLocalTime() +25 ?.?.?(Document ?, BinaryWriter ?) +2631 ?.?.?() +826 ?.?.?() +307 ?.?.Save(Document document, Stream stream, String fileName) +36 Aspose.Word.Document.Save(String fileName, SaveFormat fileFormat) +130 EIM.Documents.DocExporter.SaveToDocFile(Document myDoc) in c:\inetpub\wwwroot\EIM\Documents\DocExporter.cs:58 EIM.PolicyScreens.PolicyDocuments.btnCreatePackage_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\eim\policyscreens\policydocuments.aspx.cs:599 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain() +1273