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

R2 2016 not possible to load System.Web.Http and Error registering the viewer with the service.

1 Answer 170 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Fernando
Top achievements
Rank 1
Fernando asked on 13 May 2016, 03:07 PM
Hello guys, I am trying to configure Telerik Reporting for Html5 in my asp.net mvc 5 application (.Net Framework 4.5). I have another application using asp.net mvc 4 (.net 4.0) that works fine but in mvc 5 and .net 4.5 it fails. I have referenced in my asp.net mvc application the assemblies "Telerik.Reporting" and "Telerik.Reporting.Services.WebApi" (set Copy Local = true) of R2 2016 version of Telerik Reporting. I have configured the handlers in the web.config file too.

In the WebApiConfig.cs file that configure the routes for the web api, I have added the line to configure the routes for telerik reporting api.
public static void Register(HttpConfiguration config)
{
  // Web API routes
  config.MapHttpAttributeRoutes();
 
  config.Routes.MapHttpRoute(
    name: "DefaultApi",
    routeTemplate: "api/{controller}/{id}",
    defaults: new { id = RouteParameter.Optional }
  );
 
  // configure routes for telerik reporting
  Telerik.Reporting.Services.WebApi.ReportsControllerConfiguration.RegisterRoutes(config);
}


The problem is, if I add this line that configure the routes for telerik reporting, I get an error

Could not load file or assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'...

If I remove the line, the application runs fine, but when I try to execute a page with a report, I get another error on the report viewer like this:

Error registering the viewer with the service.
No HTTP resource was found that matches the request URI 'http://localhost:54925/Api/Reports/clients'.


Am I missing something? Is it a problem with the version of .net framework? How can I get it working for asp.net mvc 5 and .net framework 4.5?

Thank you.

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 14 May 2016, 12:28 PM
Hi Fernando,

In Telerik Reporting R2 2016 we detected a problem with the VS item templates for adding the HTML5 Viewer. The issue is fixed in the latest available internal build v10.1.16.513. Internal builds can be downloaded from your Telerik account - Products&Subscriptions - Latest Internal Builds.


In case the project uses greater versions of the Nuget packages added also by the VS item template, you will have to make an update through the VS Nuget Package Manager. Visual Studio must add proper binding redirects in the root level's web.config.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Fernando
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or