# ELK .NET Agent is impacting AZ Commands when application starts Working

**URL:** <https://discuss.elastic.co/t/elk-net-agent-is-impacting-az-commands-when-application-starts-working/342431>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [September 6, 2023, 10:40am UTC](https://discuss.elastic.co/t/elk-net-agent-is-impacting-az-commands-when-application-starts-working/342431 "2023-09-06T10:40:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vijay.kumarkammar](https://avatars.discourse-cdn.com/v4/letter/v/73ab20/32.png) [@Vijay.kumarkammar](https://discuss.elastic.co/u/Vijay.kumarkammar)\
**Post date:** [September 6, 2023, 10:40am UTC](https://discuss.elastic.co/t/elk-net-agent-is-impacting-az-commands-when-application-starts-working/342431/1 "2023-09-06T10:40:24Z")

</div>

HI Team,

Kibana version: 8.6.1

Elasticsearch version: 8.6.2

APM Server version: 8.6.1

APM Agent language and version: dotnet Agent version1.21.0

Our Application is deployed in HA with Active - Active mode. we have deployed the ELK .NET Agent on the Servers and it was working fine.

But While Application Transaction failing internal for AZ commands and give below error message which is pointing to ELK APM Agent.

_1_  
_&lt;![CDATA[Error:_  
_Could not load file or assembly 'file:///C:\elastic\_apm\_profiler\_1.23.0\net462\System.Runtime.CompilerServices.Unsafe.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)_  
_]]&gt;_

Now we have stopped the Agent due this issue. we even upgrade to latest Agent bitz but also same issue.

Thanks & Regards,  
Vijay Kumar Kammar.

---

<div class="post-metadata">

**Author:** ![GregKalapos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gregkalapos/32/37205_2.png) [@GregKalapos](https://discuss.elastic.co/u/GregKalapos)\
**Post date:** [September 6, 2023, 3:00pm UTC](https://discuss.elastic.co/t/elk-net-agent-is-impacting-az-commands-when-application-starts-working/342431/2 "2023-09-06T15:00:51Z")

</div>

Hi @Vijay.kumarkammar ,

I assume the issue is that you set the environment variables for the [profiler based agent](https://www.elastic.co/guide/en/apm/agent/dotnet/current/setup-auto-instrumentation.html) machine-wide. Can that be the case?

If that's not the case, can you tell me how you enabled the agent?

If that's not the case, then one workaround would be to make sure you only set the environment variables for applications that you want to monitor - and not globally.

I'm not familiar with your exact environment, but I hope these pointers help.

---

<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:** [October 4, 2023, 3:01pm UTC](https://discuss.elastic.co/t/elk-net-agent-is-impacting-az-commands-when-application-starts-working/342431/3 "2023-10-04T15:01:46Z")

</div>

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