# Failed to install APM Agent .net with Profiling Auto instrumentation

**URL:** <https://discuss.elastic.co/t/failed-to-install-apm-agent-net-with-profiling-auto-instrumentation/327620>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [March 14, 2023, 3:55am UTC](https://discuss.elastic.co/t/failed-to-install-apm-agent-net-with-profiling-auto-instrumentation/327620 "2023-03-14T03:55:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zerratriani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zerratriani/32/113308_2.png) [@zerratriani](https://discuss.elastic.co/u/zerratriani)\
**Post date:** [March 14, 2023, 3:55am UTC](https://discuss.elastic.co/t/failed-to-install-apm-agent-net-with-profiling-auto-instrumentation/327620/1 "2023-03-14T03:55:40Z")

</div>

Hi, I am trying to install APM on a .net application using the Profiling Auto instrumentation method according to the following document: [Profiler Auto instrumentation | APM .NET Agent Reference [1.x] | Elastic](https://www.elastic.co/guide/en/apm/agent/dotnet/current/setup-auto-instrumentation.html)

I have set the path according to the documentation as follows:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/2/328bcb09a4128c13c6e31c723bdb75436509bdb9.png)

When I try to run the application there is an error like the following:

> Exception: System.PlatformNotSupportedException: Performance Counters are not supported on this platform.  
> at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName)  
> at Elastic.Apm.Metrics.MetricsProvider.SystemTotalCpuProvider.GetSamples() in C:\Users\jenkins\workspace\net\_apm-agent-dotnet-mbp\_v1.20.0\apm-agent-dotnet\src\Elastic.Apm\Metrics\MetricsProvider\SystemTotalCpuProvider.cs:line 109

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [March 14, 2023, 4:05am UTC](https://discuss.elastic.co/t/failed-to-install-apm-agent-net-with-profiling-auto-instrumentation/327620/2 "2023-03-14T04:05:27Z")

</div>

> **[Reporter configuration options | APM .NET Agent Reference \[1.x\] | Elastic](https://www.elastic.co/guide/en/apm/agent/dotnet/current/config-reporter.html)**

Did you also set the core configurationd

```auto
ELASTIC_APM_SERVER_URL
ELASTIC_APM_SECRET_TOKEN
ELASTIC_APM_SERVICE_NAME

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 4, 2023, 12:05am UTC](https://discuss.elastic.co/t/failed-to-install-apm-agent-net-with-profiling-auto-instrumentation/327620/3 "2023-04-04T00:05:53Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
