Troubleshooting and Tips for the .NET Agent

The following are some common configuration issues and recommended practices for working with .NET agents:
apmdevops106
The following are some common configuration issues and recommended practices for working with .NET agents:
Correcting version information for agent extensions
Depending on when you install the .NET agent and any optional extensions, it is possible for the version number of an extension to be different from the version number of the .NET agent. In most cases, if the version information differs between the .NET agent and the extension, the agent logs error messages and the extension fails to function correctly. To correct this type of problem, you can manually update the version information. Depending on your environment, do one of the following:
  • configure individual applications to use the correct agent version number.
  • configure all applications to globally use the correct agent version number.
Choose only
one
option; do not perform both options.
To configure version information for individual applications:
  1. If the extension you are installing is a regular
    .exe
    , create a file called <
    Extension_Name
    >.exe.config and place this file in the same directory as the original
    .exe
    .
  2. If the extension is an IIS application, create a file called w3wp.exe.config and place it in the same directory as w3wp.exe. This is for the default domain.
  3. If the extension is an IIS application, also add the following to web.config for each individual application:
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
          <assemblyIdentity name="
    ...
    "
    ...
    />
          <bindingRedirect oldVersion="0.0.0.0 - 65535.65535.65535.65535" newVersion="
    <AGENT.VERSION.NUMBER>
    "/>
       </dependentAssembly>
    </assemblyBinding>
    Enter an assemblyIdentity name and replace the agent version number with your .NET agent version number. The version information should consist of four digits. For example, if you installed the
    9.7.0.0 
    version of the .NET agent, you would add the following:
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
          <assemblyIdentity name="wily.Agent"   publicKeyToken="2B41FDFB6CD662A5"/>
          <bindingRedirect oldVersion="9.0.5.0 - 65535.65535.65535.65535" 
    newVersion="9.7.0.0"
     />
       </dependentAssembly>
    </assemblyBinding>
If the files above already exist, add the
<assemblyBinding>
node under
<runtime>
.
To configure ALL applications globally:
  • Add the following to the machine.config file, generally located in the %runtime install path%
    \Config
    directory of your application:
    assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
          <assemblyIdentity name="
    ...
    "
    ...
    />
          <bindingRedirect oldVersion="0.0.0.0 - 65535.65535.65535.65535" newVersion="
    <AGENT.VERSION.NUMBER>
    "/>
       </dependentAssembly>
    </assemblyBinding>
    Enter an assemblyIdentity
    name
    and replace the agent version number with your .NET agent version number. The version information should consist of four digits. For example, if you installed the
    9.7.0.0
     version of the .NET agent, you would add the following:
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
          <assemblyIdentity name="wily.Agent"   publicKeyToken="2B41FDFB6CD662A5"/>
          <bindingRedirect oldVersion="9.0.5.0 - 65535.65535.65535.65535" 
    newVersion="9.7.0.0"
     />
       </dependentAssembly>
    </assemblyBinding>
Adding the code snippet to machine.config globally affects all applications.
Choosing to use or disable the hotdeploy directory
The hotdeploy directory enables you to deploy new directives without editing the IntroscopeAgent.profile and, often, without having to restart managed applications. This ability heightens the need for caution. If your custom PBDs contain invalid syntax, or are configured to collect too many metrics, the impact will be felt more quickly. Invalid PBDs can cause NativeProfiler to shut off and PBDs that collect too many metrics can affect application performance.
To address this, CA Technologies recommends:
  • testing and validating all directives in QA and performance environments before pushing them out to production environments.
  • ensuring that your server environment's change control process is updated to reflect the new option for deploying PBDs.
When a new PBD is placed in the hotdeploy directory, the .NET agent automatically deploys the new PBD. However, classes and applications that are already running are not affected by the new or changed PBD until the application is restarted.
You can only deploy PBD files in the hotdeploy directory. The agent ignores any ProbeBuilder Lists (PBLs) placed in the directory.
If you want to prevent invalid PBD files from being deployed automatically, you can disable the use of the hotdeploy directory.
To disable the hotdeploy directory:
  1. Move any of the custom PBDs stored in the hotdeploy directory to the
    <Agent_Home>
    directory.
  2. Open the IntroscopeAgent.profile in a text editor.
  3. Remove hotdeploy from the introscope.autoprobe.directivesFile property.
  4. Add the custom PBDs you want to use to the introscope.autoprobe.directivesFile. For example:
    introscope.autoprobe.directivesFile=default-typical.pbl,custom1.pbd,custom2.pbd,custom3.pbd
  5. Save the IntroscopeAgent.profile and restart the agent.