This is a migrated thread and some comments may be shown as answers.

CompositionContractMismatchException on Cut, Copy, Paste

1 Answer 134 Views
RichTextBox (obsolete as of Q3 2014 SP1)
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 03 Jan 2013, 10:37 PM
UPDATE: I solved this problem. It was caused by referencing a local Telerik dll in my project while at the same time having a different Telerik version installed. I'm assuming the Control was getting a mismatch between the local dll and one from the GAC.

I'm using an HtmlFormatProvider to store and retrieve text as HTML. I implemented the Cut, Copy, Paste controls by implementing a click handler on the toolbar button and calling the corresponding method on my private RadRichTextbox. When the Cut method is called it throws this exception:

Cannot cast the underlying exported value of type 'Telerik.WinControls.RichTextBox.FileFormats.Html.HtmlFormatProvider (ContractName="Telerik.WinControls.RichTextBox.FormatProviders.IDocumentFormatProvider")' to type 'Telerik.WinControls.RichTextBox.FormatProviders.IDocumentFormatProvider'.

Any suggestion would be much appreciated.

1 Answer, 1 is accepted

Sort by
0
Svett
Telerik team
answered on 08 Jan 2013, 05:00 PM
Hello Paul,

I am glad to determine that you have solved the issue on your own.  Do not hesitate to contact us, if you have any other questions.

All the best,
Svett
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Tags
RichTextBox (obsolete as of Q3 2014 SP1)
Asked by
Paul
Top achievements
Rank 1
Answers by
Svett
Telerik team
Share this question
or