Hi Telerik,
I have a few questions regarding the usage of the RadDocument. According to my scenario I prepare different Documents in Designer (using RadRichTextBox) with Placeholders, which are implemented with the InlineUIContainers and child TextBlock element, and then this serialize document to HTML and retain in the Storage.
In the various Application background processes we use the prepared Doument "template" for generating HTML documents, by replacing the Placeholders with the real-time data.
To do it, we try to deserialize the RadDocument from the HTML and then use RadDocument DOM model for easier and safer Placeholder replacement operation. The only way we found to do it on Application Server is to use methods HtmlFormatProvider.Import, HtmlFormatProvider.Export. BUT they are not designed to be used in a such way as they expect to be run only in STA thread, so we got an exception:
InvalidOperationException with message "The calling thread must be STA, because many UI components require this."
Creating a dedicated STA thread for processing each documents works only under non-stressful conditions, and definitely failed on contrary with the confusing exception:
System.ComponentModel.Win32Exception (0x80004005): The operation completed successfully
Could you please suggest any way to overcome our problem, or suggest another approach for working with RadDocuments in background processes?
Thanks