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)