# Invalid Token error from Elastic APM .Net agent

**URL:** <https://discuss.elastic.co/t/invalid-token-error-from-elastic-apm-net-agent/380206>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [July 17, 2025, 8:42am UTC](https://discuss.elastic.co/t/invalid-token-error-from-elastic-apm-net-agent/380206 "2025-07-17T08:42:11Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [July 24, 2025, 4:11pm UTC](https://discuss.elastic.co/t/invalid-token-error-from-elastic-apm-net-agent/380206/7 "2025-07-24T16:11:23Z")

</div>

Thanks for sharing @kinjalgranicus. It looks like the thread is being killed:

> 2025-07-23 21:04:51.579 +00:00][126][Error] - {BackendCommComponentBase (CentralConfigurationFetcher)} WorkLoop Current thread: `ElasticApmCentralConfigurationFetcher' (managed ID: 126) +-\> Exception: System.Threading.ThreadAbortException: Thread was being aborted.  
> at System.Threading.Monitor.ObjWait(Boolean exitContext, Int32 millisecondsTimeout, Object obj)  
> at System.Threading.ManualResetEventSlim.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)  
> at System.Threading.Tasks.Task.SpinThenBlockingWait(Int32 millisecondsTimeout, CancellationToken cancellationToken)  
> at System.Threading.Tasks.Task.InternalWait(Int32 millisecondsTimeout, CancellationToken cancellationToken)  
> at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)  
> at Elastic.Apm.BackendComm.CentralConfig.CentralConfigurationFetcher.WorkLoopIteration()  
> at Elastic.Apm.BackendComm.BackendCommComponentBase.WorkLoop()

This may be a long shot as I'm not a .NET developer, but I did come across [this solution](https://discuss.elastic.co/t/auto-instrumention-metrics-work-traces-not-received/295559/21) where they had thread issues relating to shared DLLs. Can you see if amending your configuration works? If not I think it will need to fed back onto the GitHub issue.

---

_[View the full topic](https://discuss.elastic.co/t/invalid-token-error-from-elastic-apm-net-agent/380206)._
