Progress® Telerik® Reporting R3 2021

New to Telerik Reporting? Download free 30-day trial

How to Self Host Telerik Reporting REST Web API

ASP.NET Web API does not require IIS. You can self-host a Web API in your own host process. This tutorial shows how to host a Telerik Reporting REST Web API inside a console application. For more information on the hosting options see: Hosting ASP.NET Web API

To create a self-hosted HTTP service follow the steps below:

  1. On an elevated console (“Run as administrator”), execute the following command for example to allow the running user to listen on port 8080:

    netsh http add urlacl url=http://+:8080/ user=DOMAIN\user

  2. On Visual Studio, create a “Console Application” project;

  3. Install the Microsoft.AspNet.WebApi.SelfHost 4.0.30506 NuGet package;

    The Reporting REST WebAPI Service is built against WebAPI 1. In case you have to use newer version of Microsoft.AspNet.WebApi.SelfHost (e.g. WebAPI 2) you have to redirect the System.Web.Http and System.Net.Http.Formatting to their newer version. To do this, add the following bindingRedirects to your app.config and replace with the exact version:

    <?xml version="1.0" encoding="utf-8" ?>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <assemblyIdentity name="System.Web.Http" culture="neutral" publicKeyToken="31bf3856ad364e35"/>
            <bindingRedirect oldVersion="" newVersion=""/>
            <assemblyIdentity name="System.Net.Http.Formatting" culture="neutral" publicKeyToken="31bf3856ad364e35"/>
            <bindingRedirect oldVersion="" newVersion=""/>

    Visual Studio NuGet Package Manager can add the required binding redirects automatically, if you update NuGet packages through it.

  4. Make sure that the project have the following assembly references:

    • System.Web

    • Newtonsoft.Json.dll

    • System.Web.Http.dll

    • System.Web.Http.SelfHost.dll

    • System.Net.Http.dll

    • System.Net.Http.Formatting.dll

  5. Implement the reports controller;

  6. using System;
    using System.Linq;
    using System.Web.Http.SelfHost;
    using Telerik.Reporting.Services.WebApi;
    class Program
        static void Main(string[] args)
            var config = new HttpSelfHostConfiguration("http://localhost:8080"); // use appropriate address
            var server = new HttpSelfHostServer(config);
            Console.WriteLine("Server is opened");
  7. Run the console app;

  8. To verify whether the service works correctly you can make a sample request for the available document formats using the following URL:


    If the request is successful you should receive the document formats encoded in JSON. For more information see: Get Available Document Formats.

  9. When you are finished self-hosting, be sure to delete the reservation:

    netsh http delete urlacl url=http://+:8080/

See Also

In this article
Not finding the help you need?