The .NET agent can be added to an application in three different ways
- NuGet packages
-
The agent ships as a set of NuGet packages available on nuget.org. You can add the Agent and specific instrumentations to a .NET application by referencing one or more of these packages and following the package documentation.
- Profiler runtime instrumentation
-
The agent supports auto instrumentation without any code change and without any recompilation of your projects. See [setup-auto-instrumentation].
- Host startup hook
-
On .NET Core 3.0+, the agent supports auto instrumentation without any code change and without any recompilation of your projects. See Zero code change setup on .NET Core for more details.
./setup-auto-instrumentation.asciidoc ./setup-asp-net-core.asciidoc ./setup-dotnet-net-core.asciidoc ./setup-asp-dot-net.asciidoc
If you have a .NET application that is not covered in this section, you can still use the agent and instrument your application manually.
To do this, add the Elastic.Apm package to your application and use the [public-api] to manually create spans and transactions.