Alaa'
Alaa'

Reputation: 487

Could not load 'Telerik.Windows.controls.FixedDocumentViewers'

I'm working with WPF and Telerik controls. I encapsulated RadPDFViewer inside ControlTemplate (I did that before for RadGauge and it works good), after I added all the required assemblies. In the designer(user control) I can see the component as a gray rectangle but when I run the application it gives me error as u see in the attached file and it doesn't show me the component. When I use RadPDFViewer not inside the ControlTemplate, in regular window it works fine.

Why only 'Telerik.Windows.controls.FixedDocumentViewers' can't be loaded (BTW all my assemblies) are the same version.

Thank you enter image description here

Upvotes: 0

Views: 1587

Answers (3)

Alaa'
Alaa'

Reputation: 487

I solved it. It's huge solution so I have to add this assembly to the startup project. Thanks a lot

Upvotes: 0

Mark Travis
Mark Travis

Reputation: 1089

The error you are getting is obviously around missing dependencies. The information you have given is not enough to respond with a definitive answer. So I will give you a best guess

You need to ensure that you copy to the output folder the assemblies Telerik.Windows.Controls.FixedDocumentViewers has a reference to. Not all references will be required as .net only loads assemblies when it requires them.

I will assume you are using the standard binaries and not the noxaml binaries.

So, using JetBrains dotPeek (a free .net decompiler), I got the following.

Telerik.Windows.Controls.FixedDocumentViewers has a dependency on the following

  1. Telerik.Windows.Control,
  2. Telerik.Windows.Documents.Core and
  3. Telerik.Windows.Documents.Fixed

Telerik.Windows.Documents.Core has a Dependency on

  1. Telerik.Windows.Zip.

and Telerik.Windows.Documents.Fixed has a dependency on

  1. Telerik.Windows.Documents.Core

All of the assemblies has references to the usual suspects.

Since you appear to be playing with PDF files, you may need to load Telerik.Windows.Documents.FormatProviders.Pdf and if so, it has a dependency on

  1. Telerik Windows.Documents.

and the other dependencies are mentioned previously.

To solve your problem, I would add the first 3 to your solution (Telerik.Windows.Controls is probably already added), and then add each of the other assemblies in turn until you find what you require.

I hope this helps.

Upvotes: 2

tim
tim

Reputation: 1369

In the VS Solution Explorer, right-click the Reference and make sure Copy Local is set to True.

Upvotes: 0

Related Questions