Resolve Issues with NServiceBus Backends

Warning: References to third parties are for informational purposes only and should not be construed as a suggestion of endorsement or partnership. All rights related to any such references are reserved for the respective owner or party.

  • If you are using NServiceBus version 6 and get the following exception mentioning a Splunk AppDynamics .Net Agent assembly. Your environment might be affected by the NServiceBus AssemblyScanner known issue.
    Unhandled exception. System.Exception: Could not load '....some_assembly_name.dll'. Consider excluding that assembly from the scanning.
    ---> System.IO.FileLoadException: Assembly with same name is already loaded

    To fix the issue, it is recommended to stop NServiceBus AssemblyScanner from unnecessary scanning of Splunk AppDynamics .Net Agent assemblies. You can perform one of the following workarounds suggested by NServiceBus:

    1. Configure exclude rules for Splunk AppDynamics .Net Agent assemblies in your application. See NServiceBus AssemblyScanner specification to know more about assembly scanning and how to exclude assemblies from the scan.

    2. Move Splunk AppDynamics .Net Agent assemblies out of the paths that NserviceBus AssemblyScanner scans. You can choose one of the following options:

      • Your application's working directory is the default scanning path. If your application does not have any specific configuration for NServiceBus AssemblyScanner, ensure that the Splunk AppDynamics .Net Agent assemblies are not in your application's working directory. The best option is to move the assemblies into a nested folder of your working directory. You can also choose to move the assemblies completely out of the working directory.

      • If your application includes a special configuration for NserviceBus AssemblyScanner that scans additional paths or scans of nested folders, it is recommended to move the Splunk AppDynamics .Net Agent assemblies out of these paths. See NServiceBus AssemblyScanner specification to know more about assembly scanning and how to exclude assemblies from the scan.

  • If you have NServiceBus version 5 and are not seeing downstream correlation on the receiver, verify the threading architecture on the receiver. Set thenservicebus-single-threadedapp agentnode property to "false" on the multithreaded receivers.

  • Only use the node properties for MSMQ, msmq-single-threaded and msmq-correlation-field, if you are using MSMQ independently of NServiceBus. The .NET Agent does not use MSMQ node properties when discovering and instrumenting NServiceBus over MSMQ transport.
  • If you are using NServiceBus version 4, you can disable NServiceBus instrumentation on both the publisher and the receiver:
    • Copy the following Instrumentation element to a child of the Machine Agent element:

      <!--Disable NServiceBus instrumentation-->
      <instrumentation>
      <instrumentor name="NServiceBusReceiveContextInstrumentor" enabled="false" />
      <instrumentor name="NServiceBusPublishExitInstrumentor" enabled="false" />
      <instrumentor name="NServiceBusEntryInstrumentor" enabled="false" />
      <instrumentor name="NServiceBusExitInstrumentor" enabled="false" />
      </instrumentation>

      For more information, see "Instrumentation Element" on .NET Agent Configuration Properties.

    • Configure the publisher and receiver as you would for MSMQ or RabbitMQ.