Report Preview In VS fails

2 posts, 0 answers
  1. david
    david avatar
    210 posts
    Member since:
    May 2007

    Posted 13 Apr Link to this post

    Using the designer in VS2016, Reporting Q12016, when I preview a report that is in the VS designer i get these messages

     

    Error CS0234 The type or namespace name 'WebApi' does not exist in the namespace 'Telerik.Reporting.Services' (are you missing an assembly reference?) ReportLibraryC:\inetpub\MEWTG\Reports\ReportLibrary\Controllers\ReportsController.cs7

    ErrorCS0246 The type or namespace name 'ReportsControllerBase' could not be found (are you missing a using directive or an assembly reference?) ReportLibrary C:\inetpub\MEWTG\Reports\ReportLibrary\Controllers\ReportsController.cs11

    ErrorCS0234 The type or namespace name 'Http' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) ReportLibraryC:\inetpub\MEWTG\Reports\ReportLibrary\Global.asax.cs15

    ErrorCS0012 The type 'HttpConfiguration' 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'.ReportLibraryC:\inetpub\MEWTG\Reports\ReportLibrary\Global.asax.cs15Active

    The primary reference "Telerik.Reporting.Services.WebApi, Version=10.0.16.204, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" could not be resolved because it has an indirect dependency on the framework assembly "System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "Telerik.Reporting.Services.WebApi, Version=10.0.16.204, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" or retarget your application to a framework version which contains "System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".

  2. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 15 Apr Link to this post

    Hello David,

    Please check the How To: Add Telerik Reporting REST Web API to Web Application help article and verify that the project has all required Nuget packages for WebAPI based controllers.

    Then check the project's configuration file and verify there is only one runtime section, with only one assemblyBinding element. If there are more assemblyBinding sections, not all binding redirects will work as expected.


    On a side note, our recommendation is to have reports in a separate project, because the design-time preview requires the whole project to be built. Also if there are specific settings for accessing data or else, on design-time preview they will be executed as if Visual Studio is the running application.


    Let us know how it goes and if you need further help.

    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
  3. DevCraft banner
Back to Top