Help Docs

Configure .NET agent via NuGet Package

Monitor your web applications built in .NET Core 2.1 and above with the help of APM Insight .NET Core Agent. APM Insight .NET Core agent helps to track HTTP Requests, SQL Queries, Web API calls and Remote calls in your ASP .NET Core applications . Application exceptions can be logged with the help of logger API provided.

Note

 

This method of installation works both in Linux and Windows environment. Obtain the APM Insight .NET Core agent from Nuget by following the below given instructions - the steps are the same for both the environments.

 

Videos

Here's a quick video on how to install a Site24x7 APM Insight .NET Core agent in Windows.

Here's a quick video on how to install a Site24x7 APM Insight .NET Core agent in Linux.

To install .NET Core agent

  1. Add the Site24x7.DotNetCoreAgent to your project.
PM> Install-Package Site24x7.DotNetCoreAgent 
  1. Modify the ConfigureServices method in your Startup.cs file. Insert the following one line of code before the AddMvc() method as given in the screenshot
services.AddSite24x7ApmInsights();
    1.  Copy license key from the Site24x7 portal as given in the screenshot below
    2. If you want to add the license key, follow any of the two methods:
      1. Create an environment variable and paste the license key as mentioned below,
                   S247_LICENSE_KEY=<YOUR LICENSE KEY HERE>
      2. Navigate to the configuration file in the application's publish directory,
        • Go to <ApplicationPublishDirectory>\DotNetAgent\apminsight.conf
        • If it is not available, create the same file in the above mentioned location.
        • Add an entry in the file as, license.key=<YOUR_LICENSE_KEY>
    1. Publish and deploy your web application. 
    2. The application name will be created by default with the ASP.NET Core application name.
    3. If you want to change the application name, follow any of the two methods:
      1. Create an environment variable and set the application name as mentioned below,
                   SITE24X7_APP_NAME=<YOUR_APPLICATION_NAME>
      2. Navigate to the configuration file in the application's publish directory,
        • Go to <ApplicationPublishDirectory>\DotNetAgent\apminsight.conf
        • If it is not available, create the same file in the above mentioned location.
        • Add an entry in the file as, application.name=<YOUR_APPLICATION_NAME>
    4. Perform the transactions to collect performance metrics.
    5. The following image explains the installation procedure

To uninstall .NET Core Agent

      1. Open .NET Core application project in Visual Studio IDE.
      2. Go to startup.cs file and remove the below line of code,
                  services.AddSite24x7ApmInsights();
      1. Right click on project and select Manage NuGet Packages...
      2. Select Site24x7.DotNetCoreAgent from the installed packages list.
      3. Click Uninstall to remove the APM Insight .NET Core agent.
      4. Publish and deploy the application.

Was this document helpful?

Would you like to help us improve our documents? Tell us what you think we could do better.


We're sorry to hear that you're not satisfied with the document. We'd love to learn what we could do to improve the experience.


Thanks for taking the time to share your feedback. We'll use your feedback to improve our online help resources.

Shortlink has been copied!