# Dotnet auto instrumentation not stopping after removing system level environmnet variable

**URL:** <https://discuss.elastic.co/t/dotnet-auto-instrumentation-not-stopping-after-removing-system-level-environmnet-variable/356438>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [March 29, 2024, 6:12am UTC](https://discuss.elastic.co/t/dotnet-auto-instrumentation-not-stopping-after-removing-system-level-environmnet-variable/356438 "2024-03-29T06:12:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![prakash6174](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prakash6174/32/113334_2.png) [@prakash6174](https://discuss.elastic.co/u/prakash6174)\
**Post date:** [March 29, 2024, 6:12am UTC](https://discuss.elastic.co/t/dotnet-auto-instrumentation-not-stopping-after-removing-system-level-environmnet-variable/356438/1 "2024-03-29T06:12:40Z")

</div>

I am using dotnet profiler auto instrumentation for [asp.net](http://asp.net) framework application,  
it is working well and i can see the data coming to apm-server.

Observation 1 : updating the servicename in environment variable is not reflected. apm-server still receives older environment variable.

Observation 2 : deleting environment variable is not reflected in dotnet profiler.  
I removed all environment variables, but the apm-server still receiving data.

after system restart both updating and deleting get reflected in profiler. but we can't do system restart always in our setup.

Am I missing something, Do I have to do any steps to make the profiler get a latest environment variable.

dotnet framework runtime version : 4.8.09037

elastic apm profiler version : 1.26.0

os version : windows 2012 r2

IIS verion : 8.5

Original install method

> **[Profiler Auto instrumentation | APM .NET Agent Reference \[1.x\] | Elastic](https://www.elastic.co/guide/en/apm/agent/dotnet/current/setup-auto-instrumentation.html)**

Added all environment variables in system global level.

There are no other dotnet profilers are present in the system.

---

<div class="post-metadata">

**Author:** ![stevejgordon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stevejgordon/32/80912_2.png) [@stevejgordon](https://discuss.elastic.co/u/stevejgordon)\
**Post date:** [April 2, 2024, 10:36am UTC](https://discuss.elastic.co/t/dotnet-auto-instrumentation-not-stopping-after-removing-system-level-environmnet-variable/356438/2 "2024-04-02T10:36:39Z")

</div>

Hi, @prakash6174.

After modifying system environment variables you are generally required to run at least `iisreset` to restart the IIS process in order to pick up the new environment variables. This is slightly less invasive than a full system restart.

---

<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 30, 2024, 10:36am UTC](https://discuss.elastic.co/t/dotnet-auto-instrumentation-not-stopping-after-removing-system-level-environmnet-variable/356438/3 "2024-04-30T10:36:59Z")

</div>

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