Uninstall APM Dotnet Agent

To uninstall the APM Dotnet agent, do the following:
  1. Remove the environmental variables from Windows registry if you added them during deploying the APM Dotnet agent. Then, restart IIS or the corresponding Windows service.
  2. For APM Dotnet agent version 1.0.0 or higher, unregister .NET framework DLLs from GAC if it was registered during the APM Dotnet agent provisioning.

    If you have APM Dotnet agent version 0.6.0, skip this step.

    • Open PowerShell console and navigate to the destination directory where you provisioned the APM Dotnet agent.
    • Run the below script in PowerShell and wait for all DLLs get unregistered completely.
      [System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") | Out-Null
      $publish = New-Object System.EnterpriseServices.Internal.Publish
      $dlls = Get-ChildItem -Path .\netfx\ -Filter *.dll -File
      for($i = 0; $i -lt $dlls.Count; $i++) {
          $percentageComplete = $i / $dlls.Count * 100
          Write-Progress -Activity "Unregistering .NET Framweworks dlls from GAC"`
              -Status "Module $($i+1) out of $($dlls.Count). Uninstalling $($dlls[$i].Name):"`
              -PercentComplete $percentageComplete
          $publish.GacRemove($dlls[$i].FullName)
      }
      Write-Progress -Activity "Unregistering .NET Framweworks dlls from GAC"-Status "Ready"-Completed
  3. Remove the destination directory where you provisioned APM Dotnet agent.