Help Docs

Load agent using the .NET Core agent Loader API

By default, when you install an APM Insight .NET Core agent, the agent will be loaded along with the .NET dependencies configurations. However, this is not possible for self-contained applications. In such cases, you can install the .NET Core agent and load it using the agent loader API. To do so, add the loader agent API snippet in the startup file of the .NET Core application.

The .NET Core agent should be installed to make it work since it acts as a helper API to load the agent.


Instructions

  1. Add the NuGet package into your .NET Core web application/API project.
  2. Open the Program.cs file and add the snippet below.
    For .NET version 5.0 and below apps, insert the line of code inside the Main() method.

    For .NET version 6.0 and above apps, insert the line of code above the WebApplication.CreateBuilder() method call.
  1. Publish and deploy the application.

Was this document helpful?

Shortlink has been copied!