---
title: "Getting Started"
slug: "net-getting-started"
updated: 2023-07-21T20:35:33Z
published: 2023-07-21T20:35:33Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackify.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started

Retrace offers many basic and advanced features. In this article we will try to outline all of the amazing things that Retrace can do for your .NET applications.

## Step 1. Install Retrace Agent

The first thing you need to do is install the Retrace monitoring agent on your server. The installation directions vary depending on if you are using Windows, Linux, Azure App Services, Elastic Beanstalk, and other scenarios.

### Basic Installations

- [Windows Agent Install Overview](https://docs.stackify.com/docs/net-agent-installation-overview)

By default Retrace will instrument all IIS applications once the agent is installed. Please review our [.NET APM on Windows](/docs/net-apm-windows) guide to learn more. With a little configuration you can also enable [Windows Services](https://docs.stackify.com/docs/net-agent-installation-configure-windows-services) and define [custom transactions](https://docs.stackify.com/docs/net2-custom-instrumentation).

- [Linux Agent Install Overview](/docs/linux-installation)

To enable the .NET profiler on Linux you must set environment variables and create a `Stackify.json` file in the application folder you want to profile. Please see our guide for [.NET APM on Linux](https://docs.stackify.com/docs/dotnetcore-linux-profiler) to learn more.

### Container Based Installations

- [Docker](/docs/net-core-apm-with-docker-in-linux) (Linux)
- [Kubernetes](/docs/net-core-apm-with-kubernetes)

### Azure Deployment Scenarios

- [App Services](/docs/dotnet-azure-app-services)
- [Cloud Services](/docs/azure-installation-configure-cloud-services)

### AWS Deployment Scenarios

- [Elastic Beanstalk](/docs/aws-installation-windows-aws-elastic-beanstalk-net-deployment)
- [ECS](/docs/net-apm-with-aws-ecs)
- [Fargate](/docs/net-core-apm-with-aws-fargate)

*Note: Retrace is not designed for Windows 10 desktop usage. We would recommend trying [Prefix](https://docs.stackify.com/v1/docs/prefix) instead.*

## Step 2. Configure Your App

To ensure that Retrace will automatically profile your application and to give it a proper application and environment name, you should create a `Stackify.json` file in the root of your application deployment folder.

```
{
    "AppName": "MyApp",
    "Environment": "Production"
}
```

Note: For non web applications, you must [manually instrument your code](/docs/net2-custom-instrumentation) to define transactions for Windows Services and other forms of .NET background services.

#### Linux Environment Variables

          Note

          

Setting the environment variables should only be required on Linux systems. In Windows these values are set by the agent automatically.

The .NET CLR requires environment variables to be set in order to load a profiler into a process. There are several ways to set these environment variables. Here is an example that only needs to be set once and will be available to each new process that loads without any additional steps.

1. Open `environment` from the command-line

```
sudo nano /etc/environment
```
2. Add the environment variables

```
CORECLR_PROFILER={cf0d821e-299b-5307-a3d8-b283c03916da}
CORECLR_ENABLE_PROFILING=1
CORECLR_PROFILER_PATH=/usr/local/stackify/stackify-dotnet-apm/StackifyProfiler.so
```

If you are running your .NET Core application within systemd, you will need to modify conf file for your job.

```
[Service]
Environment=CORECLR_PROFILER={cf0d821e-299b-5307-a3d8-b283c03916da}
Environment=CORECLR_ENABLE_PROFILING=1
Environment=CORECLR_PROFILER_PATH=/usr/local/stackify/stackify-dotnet-apm/StackifyProfiler.so
```

## Step 3. Send Your Logs to Retrace

You can send your applications logs to Retrace with multiple .NET logging frameworks. Be sure to send your logs to take full advantage of Retrace's error tracking and centralized logging features. Errors are also used as part of Retrace's "App Scoring" feature.

- [log4net](/docs/errors-and-logs-log4net)
- [NLog](/docs/errors-and-logs-configure-nlog)
- [Serilog](/docs/errors-and-logs-serilog)
- [Stackify API](/docs/logs-using-stackify-api-for-net)

## Step 4. Deployment Tracking

Notify Retrace when you do a new deployment to get advanced reporting features. This makes it easy to see how performance changes after a new deployment. Popular tools like Team City, Visual Studio Team Services, Octopus Deploy and others are supported. View [our docs](/docs/deployment-tracking-overview) to learn more.

## Sending All Exceptions to Retrace

By default the new .NET profiler only captures "unhandled" exceptions to avoid the overhead of a first-chance exception handler. However, if you want to capture and upload all first-chance exceptions you can enble this on a per application basis. To enable this, add the setting `CaptureAllExceptions` to the `Stackify.json` file as shown in the following example.

```
{
    "AppName": "MyApp",
    "Environment": "Production",
    "CaptureAllExceptions": true
}
```

## Disabling Tracing

If you want to temporarily disable collection of APM data, you can add a property to the `Stackify.json` file to cause the profiler to be disabled. This does not impact collection of logs that are sent to Retrace.

This is useful to disable profiling of some applications on your server but not all.

```
{
    "AppName": "MyApp",
    "Environment": "Production",
    "DisableTracing": true
}
```

## Additional Topics

- **Custom Metrics** - [Track custom metrics](/docs/custom-metrics-configure-for-net) in your code with the Stackify API.
- **Custom Instrumentation** - [Customize what Retrace profiles](/docs/net2-custom-instrumentation) and the data it collects.
