Back to Devexpress

Connect the XPO Profiler to an ASP.NET Core Application

xpoprofiler-400001-profile-aspnet-core-applications.md

latest2.3 KB
Original Source

Connect the XPO Profiler to an ASP.NET Core Application

  • Aug 27, 2021
  • 4 minutes to read

This topic describes how to use the XPO Profiler to profile ASP.NET Core applications.

Connection Setup

  1. Create the following controller:

  2. Add the following code to the Startup.ConfigureServices method:

  3. Make sure that the Configure method has the code that adds endpoints for controller actions:

  4. Run the XPO Profiler. Click File | New. In the New Host dialog, supply the following parameters:

  5. Click Test to test the connection.

Authentication Setup

XPO Profiler supports the following authentication types when using WebAPI binding:

Authentication TypeDescriptionAuthentication Dialog
AnonymousYour web application should provide anonymous access to the controller demonstrated in the Connection Setup section.None
BasicXPO profiler displays the Authentication dialog where you can specify the login and password.
Token-BasedXPO profiler displays the Authentication dialog where you can specify the authentication token. Your web application should implement a custom authentication handler (see the section below for details).

Token-Based Authentication

  • Implement the following XpoProfilerTokenHandler authentication handler:

  • Register your custom authentication handler in the Startup.ConfigureServices method declared in the Startup.cs file.

  • Apply the Authorize attribute to your XpoLoggerController class (demonstrated in the Connection Setup section).

See Also

A Console XPO Profiler