I am running Microsoft .NET framework Version: 2.0.50727.3620 ASP.Net Version2.0.50727.3618. Using ASPOSE.Words Assembly runtime version v1.1.4322 Version 8.0.0.0.
We have moved the application that was executing from one service provider to another (Network Solutions). After moving we are executing on the functions which generates a report and received an exception “Operation could destabilize the runtime” The stack trace shows:
Aspose.words.document.[](Stream[], loadformat[], string[]) + 1285
Aspose.words.document.[](Stream[], loadformat[], string[]) + 109
Aspose.words.document..ctor(string fileName, LoadFormat loadFormat, String password) + 126
Aspose.words.document..ctor(string, filename) + 9
EventM.ReportGen.Generate() + 146
…
Code looks like:
public string Generate()
{
string reportDir = HttpContext.Current.Server.MapPath("Reports/");
string filePath = Path.Combine(reportDir, template);
if (!File.Exists(filePath))
return string.Format("Report {0} template does not exist on server", template);
if (reporttype == "I")
PopulateIncident();
else
PopulateEvent();
PopulateMisc();
Document doc = new Document(filePath);
// Header Merge Fields
String[] fieldNames = new String[]
{
"CurrentDate",
"CurrTime",
"DoctorName",
"CalendarName",
"StartDate",
"EndDate",
"StartDay",
"EndDay",
"CenterName"
};
Object[] fieldValues = new Object[]
{
CurrentDate,
CurrTime,
DoctorName,
CalendarName,
StartDate,
EndDate,
StartDay,
EndDay,
CenterName
};
doc.MailMerge.Execute(fieldNames, fieldValues);
doc.MailMerge.ExecuteWithRegions(dt);
…
The highlighted "Document doc = new Document(filePath); statement appears to be where we are throwing the error.
Are there issues with the DLL I am using? I tried finding a later version, but it was incompatible with ASP.Net version 2.