We currently have an application (Windows service) that connects to another of our applications and grabs invoices. In the invoices there is a RTF field for the footer/heade
I ended up using this. I know that it may not parse 100% of RTF text but we ran it against our live data to test it and it works fine for our purposes.
Regex.Replace(rtfString, @"\{\*?\\[^{}]+}|[{}]|\\\n?[A-Za-z]+\n?(?:-?\d+)?[ ]?", "");
I would say this is probably thrown on terminal type machines that don't have the UI libraries installed? Or possibly don't have them loaded (ie - if no user is logged in)
It's generally not a great idea to use UI libraries in a service, because there is no guarantee that those libraries are accessible if no user is logged in.
I would find a different way to remove the RTF formatting