Trying to add a Telerik Report

4 posts, 0 answers
  1. Joe
    Joe avatar
    209 posts
    Member since:
    May 2012

    Posted 28 Mar Link to this post

    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)

     

  2. Silviya
    Admin
    Silviya avatar
    377 posts

    Posted 02 Apr Link to this post

    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
  3. Joe
    Joe avatar
    209 posts
    Member since:
    May 2012

    Posted 02 Apr in reply to Silviya Link to this post

    Except that I tried all that, thus resulting in the errors I already listed.  
  4. Silviya
    Admin
    Silviya avatar
    377 posts

    Posted 05 Apr Link to this post

    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
Back to Top