# Running Sealights profilers alongside Contrast Security

When running SeaLights with Contrast Security, the configuration must be aligned with Contrast's implementation of profiler-chaining.

{% hint style="info" %}
Refer to Contrast Security .NET Agent documentation for more information:

* [Profiler chaining for the .NET Framework agent](https://docs.contrastsecurity.com/en/-net-framework-profiler-chaining.html)
* [Profiler chaining for the .NET Core agent](https://docs.contrastsecurity.com/en/-net-core-profiler-chaining.html)
  {% endhint %}

## Pre-requisites for Contrast Security profiler chaining <a href="#pre-requisites-for-contrast-security-profiler-chaining" id="pre-requisites-for-contrast-security-profiler-chaining"></a>

* Have Contrast Security installed & configured as a profiler
* Have SeaLights installed & configured the required environment variables (see below)

## Configuring Contrast Security to run additional profilers <a href="#configuring-contrast-security-to-run-additional-profilers" id="configuring-contrast-security-to-run-additional-profilers"></a>

1. In the Contrast agent configuration YAML, the **enable\_chaining** property must be set to ‘**true.’**
2. Copy the following DLLs from the provided SeaLights installation to the folders specified below:
   * **SL.DotNet.IpcLibrary-1.0.0.0\_x64.DLL** should be placed in **c:\Windows\System32**
   * **SL.DotNet.IpcLibrary-1.0.0.0\_x86.DLL** should be placed in **c:\Windows\SysWow64**
3. Ensure the **`COR_PROFILER`** environment variable has the SeaLights profiler CLS ID: **`{01CA2C22-DC03-4FF5-8350-59E32A3536BA}`**
4. Once the above is completed and the service is restarted, it should start up with both profilers active.
5. If the profilers were chained successfully, 4 additional environment variables would appear with the **CONTRAST\_CCC** prefix:
   * **`CONTRAST_CCC_COR_PROFILER`**
   * **`CONTRAST_CCC_COR_PROFILER_PATH`**
   * **`CONTRAST_CCC_COR_PROFILER_PATH_32`**
   * **`CONTRAST_CCC_COR_PROFILER_PATH_64`**

### Standard SeaLights .NET Environment Variables <a href="#standard-sealights-.net-environment-variables" id="standard-sealights-.net-environment-variables"></a>

After installing the Sealights .Net agent locally on the environment, you need to apply the following environment variables to make it “registered” as a profiler. Please refer to the relevant configuration documentation page for accurate setup&#x20;

{% code overflow="wrap" lineNumbers="true" %}

```
Cor_Enable_Profiling=1
Cor_Profiler={01CA2C22-DC03-4FF5-8350-59E32A3536BA}
COR_PROFILER_PATH_32=<PATH TO SL.DotNet.ProfilerLib_x86.dll>
COR_PROFILER_PATH_64=<PATH TO SL.DotNet.ProfilerLib_x64.dll>
```

{% endcode %}
