Knowledge Base

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I install the .NET Core Microservices Agent for Windows using the required dlls?

Table of Contents

 

Who should follow these steps?

You can follow the steps in this article if your .NET Core based application is already running on a production environment or any other environment on Windows where you are targeting to instrument this application, but you don’t have the flexibility of installing the NuGet package into your application solution at this time. In spite of that, you want to instrument your running application with the AppDynamics Microservices Agent. In this scenario, you only need to deploy the required dlls and configuration directly into the production environment or any other environment where you are targeting to instrument the application.

 

If you need to install the NuGet package into your .NET project with the assistance of Visual Studio before deploying it into the production environment or any other environment for instrumentation, follow the steps outlined in Install the .NET Core Microservices Agent for Windows instead. The steps below would not apply to you.

 

What should I do before starting?

Before you instrument the .NET Core 2.0 or 2.1 based application that is running on Windows, make sure you have access to the AppDynamics Controller in which your application metrics will appear. Refer the Agent and Controller Compatibility document to ensure your Controller version is compatible with your agent version.

 

As mentioned above, these steps are intended for customers who are running .NET Core 2.0 based applications, so your .NET Core 2.0 or 2.1 based Web Application will need to be running in the IIS.

 

Steps for adding the required dlls to your existing project

1. To instrument your application with AppDynamics .NET Core Microservices Agent, you will need the required dlls and configuration in the deployment folder location. To get the dlls and configuration files, you can use or create any sample .NET based application and install the NuGet package over there to get the required files. You can access the NuGet package here.

 

You will need to get the following files from there:

  • AppDynamics.Profiler_x64.dll
  • AppDynamics.Profiler_x86.dll
  • AppDynamics.Agent.netstandard.dll
  • AppDynamicsConfig.json file
  • AppDynamicsAgentLog.config

 

The screenshot below shows an example of a publish folder that is mapped to an application that is configured and running in the IIS. 

Screen Shot 2018-08-03 at 5.35.57 PM.png

 

2. Put all of the files into the deployment folder, as shown in the screenshot below.

Remember that you need to rename the AppDynamicsConfig.json file as per your application name. In this example, the application dlls is name is TestNetCoreApplication.dll so the AppDynamicsConfig.json file will be named TestNetCoreApplication.AppDynamicsConfig.json for your application project.

 

Screen Shot 2018-08-03 at 6.27.50 PM.png

 

3. Complete the Controller connection information in the *.AppDynamicsConfig.json file as shown below.

{

 "controller": {

   "host": "example_demo.saas.appdynamics.com",

   "port": 80,

   "account": "account_name",

   "password": "password",

   "ssl": false,

   "enable_tls12": false

 },

 "application": {

   "name": "Application_Name",

   "tier": "Tier_Name",

   "node": "Node_Name"

 }

}

 

4. You can also modify the AppDynamicsAgentLog.config to add the specific path to Agent Logs.

 

Example

By default, the path will appear like this:

<target name="logfile" xsi:type="File" archiveAboveSize="5000000" maxArchiveFiles="5" createDirs="true" fileName="${environment:variable=PROGRAMDATA}\AppDynamics\DotNetAgent\Logs\AgentLog.txt" layout="${longdate} ${processid} ${processname} ${appdomainid} ${threadid} ${level} ${logger:shortName=True} ${message}" />

 

You can modify it with any of the desired locations, as shown below:

<target name="logfile" xsi:type="File" archiveAboveSize="5000000" maxArchiveFiles="5" createDirs="true" fileName="C:\APPDYNAMICS_Logs\AppDynamics\DotNetAgent\Logs\AgentLog.txt" layout="${longdate} ${processid} ${processname} ${appdomainid} ${threadid} ${level} ${logger:shortName=True} ${message}" />

 

5. Set the environment variables for the AppDynamics core agent profiler, as shown below.

CORECLR_ENABLE_PROFILING=1

CORECLR_PROFILER={39AEABC1-56A5-405F-B8E7-C3668490DB4A}

CORECLR_PROFILER_PATH_32=<actual_path>\AppDynamics.Profiler_x86.dll

CORECLR_PROFILER_PATH_64=<actual_path>\AppDynamics.Profiler_x64.dll

Where <actual_path> is the complete path to the AppDynamics.Profiler dll.

 

6. You can also set the environment variable in the Web.config file so it will get the value during the runtime.

 

Example

<?xml version="1.0" encoding="utf-8"?>

<configuration>

 <system.webServer>

   <handlers>

     <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />

   </handlers>

   <aspNetCore processPath="dotnet" arguments=".\TestNetCoreApplication.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout">

<environmentVariables>

    <environmentVariable name="CORECLR_ENABLE_PROFILING" value="1" />

    <environmentVariable name="CORECLR_PROFILER" value="{39AEABC1-56A5-405F-B8E7-C3668490DB4A}" />

    <environmentVariable name="CORECLR_PROFILER_PATH_64" value=".\AppDynamics.Profiler_x64.dll" />

  </environmentVariables>

  </aspNetCore>

 </system.webServer>

</configuration>

<!--ProjectGuid: 99ed82fd-f96d-48bc-92f7-7615a67d89a8-->

  

7. Restart your hosted application. Your app will instrument through the agent and report data to the configured Controller.

Version history
Revision #:
4 of 4
Last update:
a week ago
Updated by:
 
Labels (1)
0 Kudos