Hello
I get sometimes a runtime error in production:
Message: Object reference not set to an instance of an object.
StackTrace: at Telerik.Web.UI.RadEditor.<get_Text>b__b(Match m)
at System.Text.RegularExpressions.RegexReplacement.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat)
at System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator)
at System.Text.RegularExpressions.Regex.Replace(String input, String pattern, MatchEvaluator evaluator, RegexOptions options)
at Telerik.Web.UI.RadEditor.get_Text()
at xyz.CN_BL.cnExportMethodsBL.writeEXTFlat(List`1 toWriteInSheet, SpreadsheetDocument xlDoc, WorkbookPart workbookPart, WorksheetPart& worksheetPart, Int32 iColIndex, ExtWert extW, Stamm st, Sheet sh, UInt32& indexRow, AdminTexte at, Int32 aktSprache) in C:\Projekte\xyz\CN_BL\cnExportMethodsBL.cs:line 11826
at xyz.CN_BL.cnExportMethodsBL.doExport(IObjectScope myScope, String& strShortenFileNameToUse, MemoryStream& mStream, Int32[] Export_Ids, Int32[] Export_IdsStamm, exportMode ExportMode, exportTyp ExportTyp, exportTyp ExportTypOriginal, Sprache aktSprache, Boolean bModulWFAktiv, Int32 FirmaId, Int32 ExportSprache, String strFileName, String& strError) in C:\Projekte\xyz\Web\CN_BL\cnExportMethodsBL.cs:line 6640
at xyz.CN_BL.FileFunctions_BL.startExportBackground(Object Param) in C:\Projekte\xyz\Web\CN_BL\FileFunctions_BL.cs:line 1212
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart(Object obj)
The error does not occur every time. My guess: the more data is processed, the more likely the w3wp.exe crashes, or more specific, the special export thread crashes.
I can not reproduce the error in the development environment.
Creation of the error:
The user wants to export data. The web server starts a separate thread for writing datas into an excel file (via MemoryStream). Codesnippet from the export method:
Loop, which calls the writeEXTFlat() methods multiple times
{
// static method writeEXTFlat()
... some code ...
Line 11826: Telerik.Web.UI.RadEditor re = new Telerik.Web.UI.RadEditor();
... more code without touching RadEditor ...
foreach (int i =0; x < exportRecs; i++)
{
... more code without touching RadEditor ...
re.Content = strExportDataWithHTML;
string strToExport = re.Text;
... more code without touching RadEditor ...
}
}
My question : Any idea why this error can happen? It makes totaly no sense to me. strExportDataWithHTML is always at least an empty string.
TIA
Markus