.NET auto-instrumentation not working

Kibana version: v 7.16.3

Elasticsearch version: v 7.16.3

APM Server version: v 7.16.3

Original install method (e.g. download page, yum, deb, from source, etc.) and version: GitHub - elastic/apm-agent-dotnet · GitHub

Is there anything special in your setup? Load balancer in front of the APM servers

"[2026-08-03T18:19:42.2740259+03:00] [WARN ] Assembly.Load failed for Elastic.Apm.Profiler.Managed, Version=1.34.0.0, Culture=neutral, PublicKeyToken=ae7400d2c189cf22, falling back to Assembly.LoadFrom from D:\ElasticApm\net462
System.IO.FileNotFoundException: Could not load file or assembly 'Elastic.Apm.Profiler.Managed, Version=1.34.0.0, Culture=neutral, PublicKeyToken=ae7400d2c189cf22' or one of its dependencies. The system cannot find the file specified.
File name: 'Elastic.Apm.Profiler.Managed, Version=1.34.0.0, Culture=neutral, PublicKeyToken=ae7400d2c189cf22'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at Elastic.Apm.Profiler.Managed.Loader.Startup.TryLoadManagedAssembly()"

"Line 122: [2026-08-04 11:28:07.244 +03:00][7][Error] - {ElasticApmModule.#2} Processing EndRequest event failed +-> Exception: System.NullReferenceException: Object reference not set to an instance of an object.

Line 108: [2026-08-04 11:28:07.239 +03:00][9][Error] - {ElasticApmModule.#2} Processing BeginRequest event failed +-> Exception: System.NullReferenceException: Object reference not set to an instance of an object.

at Elastic.Apm.AspNetFullFramework.ElasticApmModule.ProcessEndRequest(Object sender)

at Elastic.Apm.AspNetFullFramework.ElasticApmModule.OnEndRequest(Object sender, EventArgs e)

at Elastic.Apm.AspNetFullFramework.ElasticApmModule.ProcessBeginRequest(Object sender)

at Elastic.Apm.AspNetFullFramework.ElasticApmModule.OnBeginRequest(Object sender, EventArgs e)"

Hi, @Umut.

We'll likely need some more context to help further, such as the exact steps you used to install and configure the profiler. A few initial things to check/try.

  1. Verify the net462 folder contents - check that D:\ElasticApm\net462\Elastic.Apm.Profiler.Managed.dll exists and its file version matches 1.34.0.
  2. Re-run the install script/re-extract the zip - the profiler zip ships with both net462/ and net472/ subdirectories; both must be present.
  3. If still failing after that, add COMPlus_LoaderOptimization=1 to the IIS app pool environment variables.
  4. For the ElasticApmModule NRE - if you've added the module to web.config manually, you also need to call Agent.Setup() in their startup code, or remove the manual web.config entry and let the profiler register it automatically (once step 1 is fixed).
  5. If this still fails, enable global file logging at trace level and review the logs for further information which may help pinpoint the issue.
  6. Strongly consider upgrading the APM Server — 7.16.x is end-of-life and may not correctly process intake from a 1.34.0 agent.

Can you also let us know:

  • The Windows Server version and edition (e.g. Windows Server 2019 Standard)
  • The .NET Framework version installed on the server - you can check this by running the following in PowerShell:
    `Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full' | Get-ItemPropertyValue -Name Release`
  • The IIS application pool pipeline mode - in IIS Manager, check the app pool's Managed Pipeline Mode setting (Integrated vs Classic)