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.
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.
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.