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

Trying to add a Telerik Report

3 Answers 177 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 28 Mar 2019, 07:44 PM

We are using the Telerik for MVC, and we have an MVC application we wish to actually add a report to.  But when we do, we get the following error:

Error CS0012 The type 'ApiController' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

I cannot seem to find a System.Web.Http.dll that is earlier than the v 5.2 on my system.  I tried adding it via NuGet, but it won;t add it, giving me the following error:

PM> Install-Package System.Web.Http -Version 4.0.0
Attempting to gather dependency information for package 'System.Web.Http.4.0.0' with respect to project 'ReportTest', targeting '.NETFramework,Version=v4.6.1'
Attempting to resolve dependencies for package 'System.Web.Http.4.0.0' with DependencyBehavior 'Lowest'
Resolving actions to install package 'System.Web.Http.4.0.0'
Resolved actions to install package 'System.Web.Http.4.0.0'
Install failed. Rolling back...
Package 'System.Web.Http.4.0.0' does not exist in project 'ReportTest'
Package 'System.Web.Http.4.0.0' does not exist in folder 'C:\VensureApplications\ReportTest\packages'
Install-Package : Could not install package 'System.Web.Http 4.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6.1', but the package does not c
ontain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
At line:1 char:16
+ Install-Package <<<<  System.Web.Http -Version 4.0.0
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
 

So how do I get this thing to work?

 

Using VisualStudio 2015

Telerik v2018.1.117.545 (Kendo.mvc.dll)

 

3 Answers, 1 is accepted

Sort by
0
Silviya
Telerik team
answered on 02 Apr 2019, 12:33 PM
Hi Joe,

The quickest way to add an HTML5 MVC Report Viewer to your web project is with the Telerik HTML5 MVC Report Viewer item template in Visual Studio. Please check the How To: Use HTML5 ASP.NET MVC Report Viewer in an application. After finishing the wizard, it would automatically add System.Net.Http reference and, if necessary, would add binding redirects.

If the issue still persists, please send us the problematic project in a new support ticket for further investigation.

Best Regards,
Silviya
Progress 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
0
Joe
Top achievements
Rank 1
answered on 02 Apr 2019, 01:58 PM
Except that I tried all that, thus resulting in the errors I already listed.  
0
Silviya
Telerik team
answered on 05 Apr 2019, 07:38 AM
Hi Joe,

I suggest you could refer to the following thread: https://stackoverflow.com/questions/40720997/webapi-reference-error. You could try to re-install Microsoft.AspNet.WebApi.Core. Then, re-install System.Web.Http and save all files again.
Additionally, you might find WebApi project give me apicontroller is not referenced error thread helpful.

Best Regards,
Silviya
Progress 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
Joe
Top achievements
Rank 1
Answers by
Silviya
Telerik team
Joe
Top achievements
Rank 1
Share this question
or