# Elastic APM Attacher and .NET 6.0

**URL:** <https://discuss.elastic.co/t/elastic-apm-attacher-and-net-6-0/376098>\
**Category:** APM\
**Tags:** docker, dotnet\
**Created:** [March 18, 2025, 9:32pm UTC](https://discuss.elastic.co/t/elastic-apm-attacher-and-net-6-0/376098 "2025-03-18T21:32:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aardvark4](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aardvark4/32/142129_2.png) [@aardvark4](https://discuss.elastic.co/u/aardvark4)\
**Post date:** [March 18, 2025, 9:32pm UTC](https://discuss.elastic.co/t/elastic-apm-attacher-and-net-6-0/376098/1 "2025-03-18T21:32:24Z")

</div>

**Kibana version** :  
8.17.2

**Elasticsearch version** :  
8.17.2

**APM Server version** :  
8.17.2

**APM Agent language and version** :  
dotnet, but not sure the version (added by the attacher)

**Browser version** :  
Chrome 134.0.6998.89

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**:  
Elastic ECK and Helm

**Fresh install or upgraded from other version?**  
Fresh

**Is there anything special in your setup?** For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc.  
I don't think so

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:

I basically followed the steps from the Elastic documentation titled **"APM Attacher"** (sorry, the forum won't let me post an actual link 🤷‍♂️)

The APM attacher seems to install into the cluster properly, and the mutation all seems to work well too, in the sense that I do see the various environment variables added to my .NET pod and at least _some_ of the expected Agent files:

Pod Environment Variables:

 ![Pod Environment Variables](https://us1.discourse-cdn.com/elastic/original/3X/f/6/f67ca4563c0610d05efb13d3f3eefbf69461e4c7.png)

Container Contents:

 ![Container Contents](https://us1.discourse-cdn.com/elastic/original/3X/a/9/a9fd9bf6ba6a56b132eb5ae7cf6ee54aa269daed.png)

Based on the Elastic documentation titled **"Zero code change setup on .NET Core and .NET 5+"** (sorry, the forum won't let me post an actual link 🤷‍♂️)

It seems as though I should just need to set the `DOTNET_STARTUP_HOOKS` environment variable, but that DLL seems to be missing from what was injected into the pod (see `ls` output above). Am I missing something in terms of the APM Attacher config to inject it properly? My APM Attacher Webhook config looks like this:

```auto
webhookConfig:
  agents:
    dotnet: 
      environment:
        ELASTIC_APM_SERVER_URL: "<see screenshot above; the forum is not letting me post the actual URL>" 
        ELASTIC_APM_LOG_LEVEL: "Information"
        ELASTIC_APM_PROFILING_INFERRED_SPANS_ENABLED: true

```

I do see that there are different suggestions for a Docker container, but that requires rebuilding the image to include the APM agent, which I can do but would prefer not to if the attacher can inject it.

As a sanity check for the APM agent, I do have a dummy [ASP.NET](http://ASP.NET) Aspire application (two pods, one for the frontend and one for the API) in the test cluster pointing at that same apm address above (sorry, forum wouldn't let me use the full URL), and those both seem to work properly:

 ![Kibana APM](https://us1.discourse-cdn.com/elastic/original/3X/3/b/3b49920f702811080789367f8c9c14e6cb0eb7ff.png)

Either way, I'm clearly missing something, and figured someone here might know. Thanks in advance!

Adam
