IndexOutOfRangeException in XamlFormatProvider.Export when exporting RadDocument concurrently

0 Answers 2 Views
General Discussions RichTextBox
Zafeer
Top achievements
Rank 1
Zafeer asked on 10 Feb 2026, 01:11 PM

Hi Team,

We are encountering an intermittent IndexOutOfRangeException when calling XamlFormatProvider.Export() on a RadDocument.

Exception stack:

System.IndexOutOfRangeException at System.Collections.Generic.Dictionary`2.Insert at Telerik.Windows.Documents.FormatProviders.Xaml.XamlWriter.TryGetTypeConverter at Telerik.Windows.Documents.FormatProviders.Xaml.XamlFormatProvider.Export(RadDocument)

Code:

private string ReadDocumentText(RadDocument document) { if (document == null) return string.Empty; return new XamlFormatProvider().Export(document); }

Notes:

  • document is not null

  • Each document is different

  • Same code works for most documents

  • The exception occurs inside Telerik export logic

  • Documents are exported concurrently (parallel processing)

  • No custom type converters or custom styles added explicitly

Questions:

  • Is XamlFormatProvider.Export() thread-safe when used concurrently?

  • Can concurrent exports cause internal state corruption (e.g. type converter dictionary)?

  • Is there a recommended approach for exporting RadDocument in parallel (e.g. synchronization or per-thread isolation)?

Any guidance would be appreciated.

Thanks.
Zafeer

No answers yet. Maybe you can help?

Tags
General Discussions RichTextBox
Asked by
Zafeer
Top achievements
Rank 1
Share this question
or