New to Telerik ReportingStart a free 30-day trial

The WPF ReportViewer Throws a MethodAccessException

Environment

ProductProgress® Telerik® Reporting
VersionQ2 2012 and later
Report ViewersWPF

Description

When connecting the WPF Report Viewer to the Telerik Report Server or Telerik Reporting REST API Service, a MethodAccessException error is thrown.

Error Message

Attempt by method 'Telerik.Reporting.Services.HttpClient.HttpRequestHelper.GetResponseFromPost(System.Net.Http.HttpResponseMessage)' to access method 'Telerik.Reporting.Services.HttpClient.HttpRequestHelper.GetResponseFromPost<T> (System.Net.Http.HttpResponseMessage, System.Collections.Generic.IEnumerable 1<System.Net.Http.Formatting.MediaTypeFormatter>)' failed.

Cause

The most common reason for this exception is an incorrect version of the web client assemblies. The WPF viewer requires the Microsoft.AspNet.WebApi.Client NuGet package.

Solution

Install the assemblies required by the WPF viewer through the Visual Studio NuGet Package Manager or with the Visual Studio Package Manager Console. For more details, refer to the article on using the WPF ReportViewer with the Report Server.