New to Telerik Reporting? Download free 30-day trial

Error building project after adding WPF report viewer

Environment

Product Version 12.1.18.620
Product Progress® Telerik® Reporting
Project Type WPF
Viewer WPF Viewer

Description

Adding a WPF Report Viewer from the Visual Studio item templates to a project results System.Windows.Markup.XamlParseException.

Error Message

_System.Windows.Markup.XamlParseException
  HResult=0x80131501
  Message='Set property 'System.Windows.ResourceDictionary.Source' threw an exception.' Line number '7' and line position '10'.
  Source=PresentationFramework
  StackTrace:
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)_
_Inner Exception 1:
FileNotFoundException: Could not load file or assembly 'Telerik.ReportViewer.Wpf.Themes, Culture=neutral' or one of its dependencies. The system cannot find the file specified._

Cause\Possible Cause(s)

Starting with Telerik Reporting R2 2018 SP1 (12.1.18.620) the Themes are provided with the Telerik.ReportViewer.Wpf.Themes assembly. The assembly should be available in the bin folder of the application. Hence, the property Copy Local of the assembly should be set to True. With the specified version of Telerik Reporting when adding the WPF Report Viewer from the Visual Studio item templates the default value of Copy Local is False.

Solution

Set manually the property Copy Local of the assembly Telerik.ReportViewer.Wpf.Themes to True.

In this article