# Unable to configure Elastic APM on .NET 4.8

**URL:** <https://discuss.elastic.co/t/unable-to-configure-elastic-apm-on-net-4-8/377418>\
**Category:** Elastic Agent\
**Created:** [April 23, 2025, 6:16am UTC](https://discuss.elastic.co/t/unable-to-configure-elastic-apm-on-net-4-8/377418 "2025-04-23T06:16:46Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahulsamsung](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@rahulsamsung](https://discuss.elastic.co/u/rahulsamsung)\
**Post date:** [April 23, 2025, 6:16am UTC](https://discuss.elastic.co/t/unable-to-configure-elastic-apm-on-net-4-8/377418/1 "2025-04-23T06:16:46Z")

</div>

Dear All,

We are trying to setup Elastic APM on one of our application running on the .NET 4.8. And completed the below configuration on the application side.  
But the service is still not showing on the ELK APM dashboard. Kindly suggest.

Webconfig :-

```
    <add key="ElasticApm:ServerUrls" value="http://<ip-address>:8200" />
    <add key="ElasticApm:ServiceName" value="TAD-portal" />
    <add key="ElasticApm:Environment" value="Production" />
    <add key="ElasticApm:SecretToken" value="UAT" />
    <add key="ElasticApm:TransactionSampleRate" value="1.0" />

```

gloabl.aspx :-

using Elastic.Apm;using Elastic.Apm.AspNetFullFramework;

protected void Application\_Start()  
{  
Agent.Setup(new AgentComponents());  
}

---

<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:** [April 23, 2025, 9:43am UTC](https://discuss.elastic.co/t/unable-to-configure-elastic-apm-on-net-4-8/377418/2 "2025-04-23T09:43:49Z")

</div>

Hi @rahulsamsung,

Welcome! Which version of the .NET agent and Elasticsearch are you using?

Can you confirm that you are using [supported technologies](https://www.elastic.co/docs/reference/apm/agents/dotnet/supported-technologies) in your app? Do you see any errors or warnings from the agent in the application logs, and any logs in the Discover screen?

Let us know!

---

<div class="post-metadata">

**Author:** ![rahulsamsung](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@rahulsamsung](https://discuss.elastic.co/u/rahulsamsung)\
**Post date:** [April 23, 2025, 10:44am UTC](https://discuss.elastic.co/t/unable-to-configure-elastic-apm-on-net-4-8/377418/3 "2025-04-23T10:44:16Z")

</div>

Hey @carly.richmond

Thanks for your response.  
We are using ELK 8.15.5 and .NET 4.8. which should be supported according to the supported technologies. We didn't find any error or warning message as such.

---

<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:** [April 23, 2025, 7:19pm UTC](https://discuss.elastic.co/t/unable-to-configure-elastic-apm-on-net-4-8/377418/4 "2025-04-23T19:19:29Z")

</div>

Ok, did you try specifying the debug log level as covered in the [docs](https://www.elastic.co/docs/troubleshoot/observability/apm-agent-dotnet/apm-net-agent#)? Hopefully that shoukld give you some additional diagnostics to figure out why the agent isn't sending.

---

<div class="post-metadata">

**Author:** ![rahulsamsung](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@rahulsamsung](https://discuss.elastic.co/u/rahulsamsung)\
**Post date:** [May 21, 2025, 8:50am UTC](https://discuss.elastic.co/t/unable-to-configure-elastic-apm-on-net-4-8/377418/5 "2025-05-21T08:50:06Z")

</div>

Hi @carly.richmond  
We are still not able find any logs but we can see the traffic of agent on ELK server. Please provide your assistance.  
Also, Is there any other way to configure the APM? Without making the changes in code?  
Kindly suggest.

---

<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:** [May 21, 2025, 9:04am UTC](https://discuss.elastic.co/t/unable-to-configure-elastic-apm-on-net-4-8/377418/6 "2025-05-21T09:04:51Z")

</div>

@rahulsamsung looking at the documentation [here](https://www.elastic.co/docs/reference/apm/agents/dotnet/set-up-apm-net-agent) it looks like zero code instrumentation support is available for .NET 5 or later, so you would need to manually instrument for .NET 4.8:

> On **.NET Core 3.0+ or .NET 5+** , the agent supports auto instrumentation without any code change and without any recompilation of your projects. See [Zero code change setup on .NET Core](https://www.elastic.co/docs/reference/apm/agents/dotnet/setup-dotnet-net-core#zero-code-change-setup) for more details.

To confirm, you are seeing traffic going through the Elastic APM server? Is this a custom dashboard that you have built or one of the Observability screens in Kibana? If you could share a screenshot of what you see and your configuration we can try to help.

---

<div class="post-metadata">

**Author:** ![rahulsamsung](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@rahulsamsung](https://discuss.elastic.co/u/rahulsamsung)\
**Post date:** [May 22, 2025, 6:46am UTC](https://discuss.elastic.co/t/unable-to-configure-elastic-apm-on-net-4-8/377418/7 "2025-05-22T06:46:14Z")

</div>

We are checking the default observability APM dashboard to see the services. The traffic we captured on ELK server is using the tcpdump.

---

<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:** [May 22, 2025, 8:56am UTC](https://discuss.elastic.co/t/unable-to-configure-elastic-apm-on-net-4-8/377418/8 "2025-05-22T08:56:49Z")

</div>

Ok, but tcpdump is a command line utility. How does that relate to the .NET APM agent and the signals you're not seeing from that? Are there 2 sources that you are not seeing coming through?

Can you share a screenshot of the dashboard within APM that you're not seeing any data, along with the APM configuration for your application? It might also be a good idea to enable global file logging at DEBUG level to see if any errors are being triggered on the agent side [as per the troubleshooting docs](https://www.elastic.co/docs/troubleshoot/observability/apm-agent-dotnet/apm-net-agent).

Let us know!

---

<div class="post-metadata">

**Author:** ![Senith\_Dilitha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/senith_dilitha/32/125821_2.png) [@Senith\_Dilitha](https://discuss.elastic.co/u/Senith_Dilitha)\
**Post date:** [July 29, 2025, 10:02am UTC](https://discuss.elastic.co/t/unable-to-configure-elastic-apm-on-net-4-8/377418/9 "2025-07-29T10:02:18Z")

</div>

I'm getting below error when trying to push logs to elastic cloud from .net framework 4.7.2 application.

**Error in serilog debug logs**  
_2025-07-29T09:57:08.1178562Z Caught exception while preforming bulk operation to Elasticsearch: Elasticsearch.Net.ElasticsearchClientException: Could not authenticate with the specified node. Try verifying your credentials or check your Shield configuration. Call: Status code 401 from: POST /\_bulk ---\> Elasticsearch.Net.PipelineException: Could not authenticate with the specified node. Try verifying your credentials or check your Shield configuration. ---\> System.Net.WebException: The remote server returned an error: (401) Unauthorized._

I confirmed the base64 encoded apikey and the uri is correct using the command line by pushing logs manually.

Can you please help me resolving this??

- at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)\*
- at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)\*

---

<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 29, 2025, 2:09pm UTC](https://discuss.elastic.co/t/unable-to-configure-elastic-apm-on-net-4-8/377418/10 "2025-07-29T14:09:11Z")

</div>

Hi @Senith_Dilitha,

Welcome back! Have you tried regenerating the key and confirming that the API key has the right level of permissions. I'm aware that you say you've tried pushing the logs manually, which I'm assuming is via a cURL request or similar.

As it's been a while since you last raised your question, can you also confirm:

1. Which instrumentation approach you are using [as per the documentation](https://www.elastic.co/docs/reference/apm/agents/dotnet/set-up-apm-net-agent)?
2. Configuration (especially if it has changed since your initial question).
3. Can you also share the output of the `TRACE` level logs (configurable as per [these instructions](https://www.elastic.co/docs/troubleshoot/observability/apm-agent-dotnet/apm-net-agent)) in case the unauthorized exception is a red herring?
