Developers use .NET remoting to build distributed applications that share objects across processes or across application domains running in the same process. AppDynamics disables correlation for .NET remoting functions by default.

Instrument Applications that Use .NET Remoting

You can configure the .NET Agent to discover .NET remoting entry and exit points.

  1. Open the config.xml file for editing as administrator.  See 'Where to Configure Agent Properties' on Administer the .NET Agent

  2. Copy the code block below to a child element of the Machine Agent element. See .NET Agent Configuration Properties

        <instrumentation>
            <instrumentor name="RemotingMscorlibEntryInstrumentor" enabled="true"/>
            <instrumentor name="RemotingExitInstrumentor" enabled="true"/> 
        </instrumentation>
    CODE

    For example:

    <?xml version="1.0" encoding="utf-8"?>
    <appdynamics-agent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    ...
     <machine-agent>
        <!--Enable correlation for .NET remoting-->
        <instrumentation>
            <instrumentor name="RemotingMscorlibEntryInstrumentor" enabled="true"/>
            <instrumentor name="RemotingExitInstrumentor" enabled="true"/>
        </instrumentation>
      </machine-agent>
    ...
    </appdynamics-agent>
    CODE
  3. Save the config.xml file.
  4. Restart the AppDynamics.Agent.Coordinator service.
  5. Restart instrumented applications for your changes to take effect.

If the agent does not discover the entry points after configuration, specify an agent trigger.

Specify an Agent Trigger

.NET remoting entry point functions execute in low-level .NET libraries that may not trigger automatic agent instrumentation. If the agent does not discover the .NET remoting entry points after configuration you can specify a function that triggers the agent to begin instrumentation.

  1. Identify a function to trigger the agent to begin instrumentation. The function can be any function that executes as part of the application process.

    For example, consider the following code for a MovieTicket remoting object. In this case, use the function GetTicketStatus to trigger the agent. 

    using System;
    namespace MovieGoer
    {
        public class MovieTicket : MarshalByRefObject
        {
            public MovieTicket()
            {
            }
            public string GetTicketStatus(string stringToPrint)
            {
                return String.Format("Enquiry for {0} -- Sending back status: {1}", stringToPrint, "Ticket Confirmed");
            }
        }
    }
    
    CODE
  2. Edit the config.xml file as an administrator. See Administer the .NET Agent.

  3. Update the Instrumentation element to include the AgentTriggerInstrumentor attribute. See .NET Agent Configuration Properties.

        <instrumentation>
    		<instrumentor name="AgentTriggerInstrumentor" enabled="true" args="" />
            <instrumentor name="RemotingMscorlibEntryInstrumentor" enabled="true"/>
            <instrumentor name="RemotingExitInstrumentor" enabled="true"/> 
        </instrumentation>
    CODE
  4. Set the AgentTriggerInstrumentor args value to the name of the trigger function, using information in the code block in step 1. The args value should be formatted as follows: namespace.public_class.public_string.

    For example:

    <?xml version="1.0" encoding="utf-8"?>
    <appdynamics-agent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    ...
     <machine-agent>
        <!--Enable correlation for .NET remoting-->
        <instrumentation>
            <instrumentor name="AgentTriggerInstrumentor" enabled="true" args="MovieGoer.MovieTicket.GetTicketStatus" />
            <instrumentor name="RemotingMscorlibEntryInstrumentor" enabled="true"/>
            <instrumentor name="RemotingExitInstrumentor" enabled="true"/>
        </instrumentation>
      </machine-agent>
    ...
    </appdynamics-agent>
    CODE
  5. Save the config.xml file.
  6. Restart instrumented applications for your changes to take effect.