CompositionContractMismatchException on Cut, Copy, Paste

2 posts, 0 answers
  1. Paul
    Paul avatar
    4 posts
    Member since:
    Oct 2012

    Posted 03 Jan 2013 Link to this post

    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.
  2. Svett
    Svett avatar
    728 posts

    Posted 08 Jan 2013 Link to this post

    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,
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
  3. DevCraft R3 2016 release webinar banner
Back to Top