The .NET Agent automatically instruments IIS applications only. However, you can follow these instructions to manually configure the .NET Agent to instrument Windows services or standalone .NET applications.
If your web application is not configured to run as an in-process handler, the application may run as
mywebappapplication.exe. In this scenario, the application's site name and application path are not discovered automatically. You must configure these applications manually, and provide tier and node names that best describe the application.
Before You Begin
To instrument Windows services and standalone .NET applications, edit the .NET Agent configuration file,
If your application runs using the default domain, you must manually instrument it. AppDynamics does not automatically instrument the default domain out-of-the-box. To determine whether you should use the default domain, and how to configure it, see Instrument the DefaultDomain for Standalone Applications.
Before starting, verify that the services or applications you want to instrument are .NET applications rather than native applications or another type of application. From a command line, enter:
tasklist /m "mscor*"
This command is for 64-bit processes only. For 32-bit processes, use the process explorer to view the dependencies of the process, and determine if there are any .NET .dll files loaded into the file.
The output lists the processes with DLLs starting with mscor
*, indicative of .NET processes. Processes not displaying on the list are not .NET processes, and you cannot instrument them with the .NET Agent.
If you have previously instrumented IIS applications on the server that hosts the Windows services and standalone applications, the server should already have a
config.xml file that you can edit. If not, perform these steps to generate one:
To avoid instrumenting IIS applications, select the manual tier naming approach and omit the step of assigning tiers for the IIS application. This disables instrumentation for the IIS applications and enables you to instrument only the intended Windows services or standalone applications.
The utility performs these configuration tasks:
- Changes the location of the logs directory, and assigns permissions.
- Configures and tests connectivity to the Controller.
Sets the business application for the agent.
Manually Configure the .NET Agent
Once you have configured the Controller properties for the .NET Agent, instrument your Windows service or standalone application by adding the Standalone Applications element to the
config.xmlfile as an administrator. See Administer the .NET Agent.
If you have not instrumented any IIS applications, the file contains the minimal configuration for the Controller connectivity and the Machine Agent. Verify the Controller properties and the Business Application name (shown in this example):
If you have already instrumented IIS applications, those configurations display under the IIS element.
Add a single standalone applications element,
standalone-applicationsunder the app-agents element, and under the
standalone-applicationselement, add a standalone application element,
standalone-applicationfor each Windows service or standalone application to instrument. For example:
In the standalone application element configuration:
tierelement to assign the instrumented application to a tier in the Controller. See .NET Agent Configuration Properties.
Identify the executable file of the application in the Standalone Application element
executableattribute using one of these formats:
Executable name: For example,
MyWindowsService.exe. The file extension is optional, so
MyStandaloneAppis valid. If you use
dotnet.exeto start the .NET Core application, then specify
"dotnet.exe"as the application executable (see Sample Configuration File).
Full or partial path to the executable: For example,
MyApplication\MyStandaloneApp.exe. Use the full or partial path to assign different AppDynamics tiers to separate instances of the same executable file running from different paths.
To differentiate between two instances of the same executable, specify any unique portion of the command line invocation format of the application, such as an argument, in the Standalone Application command-line attribute.
You can discover the path to a Windows service executable in the Services panel of the administrative tools. In Services, click the service and select Properties. The path display in the General tab.
Restart the Windows service or standalone application.
If your Windows service or standalone application does not implement an auto-detected framework, you must configure a POCO entry point for a class or method in your service for the agent to begin instrumentation.
Sample Configuration File
config.xml shows instrumentation for a Windows service and standalone application:
If the .Net Core application is published as an executable, then you can configure it similar to .NET Framework applications by specifying the executable name, and optionally, the command line. However, if the application is published as a library, then you start it by by invoking the
This sample configuration shows how to instrument a .NET Core standalone application hosted by the
Intermittent Loss of Windows Services Instrumentation
When instrumenting Windows Services, there may be cases where the instrumented service initializes before the
AppDynamics.Agent.Coordinator service. When this happens, the Profiler shuts down and no instrumentation occurs. This problem is uncommon.
These procedures describe how to overcome this problem for Windows 2008, and Windows >= 2012.
If you are using Windows 2008, please contact AppDynamics Support for assistance.
Windows >= 2012
To ensure the AppDynamics.Agent.Coordinator service initializes before the instrumented Windows Service, you must modify the registry.
Edit the Reg key
EarlyStartServices @HKLM:\SYSTEM\CurrentControlSet\Control, and add AppDynamics.Agent.Coordinator_service to the list of early start services.