> For the complete documentation index, see [llms.txt](https://docs.sealights.io/knowledgebase/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/.net-core-agent/downloading-the-.net-core-agent.md).

# Downloading the .NET agent

The latest .NET Agent is available as self-contained packages for Windows, Linux, and Alpine.

Use the self-contained packages when you want the agent to run without relying on a locally installed .NET runtime.

{% hint style="info" %}
The public artifact endpoint still uses `dotnetcore` in the URL path. That path is expected.
{% endhint %}

If you need a platform-dependent package, contact Support.

<table><thead><tr><th width="122.33331298828125">OS</th><th width="396">Download link</th><th width="220.33331298828125">Minimum System Requirements</th></tr></thead><tbody><tr><td><strong>Windows</strong></td><td><a href="https://agents.sealights.co/dotnetcore/latest/sealights-dotnet-agent-windows-self-contained.zip">https://agents.sealights.co/dotnetcore/latest/sealights-dotnet-agent-windows-self-contained.zip</a></td><td>Windows 10 build 17063 (and higher)</td></tr><tr><td><strong>Linux</strong></td><td><a href="https://agents.sealights.co/dotnetcore/latest/sealights-dotnet-agent-linux-self-contained.tar.gz">https://agents.sealights.co/dotnetcore/latest/sealights-dotnet-agent-linux-self-contained.tar.gz</a></td><td>Ubuntu 20.04 (and higher), Debian 11 (and higher), RHEL 8.10 (and higher)</td></tr><tr><td><strong>Alpine</strong></td><td><a href="https://agents.sealights.co/dotnetcore/latest/sealights-dotnet-agent-alpine-self-contained.tar.gz">https://agents.sealights.co/dotnetcore/latest/sealights-dotnet-agent-alpine-self-contained.tar.gz</a></td><td>Alpine 3.18 (and higher)</td></tr></tbody></table>

{% hint style="warning" %}
When using the Alpine version, run the executable without an extension: `SL.DotNet`.
{% endhint %}

{% hint style="info" %}

* If you cannot access [agents.sealights.co](http://agents.sealights.co/), use `https://{company}.sealights.co/dotnetcore/latest/sealights-dotnet-agent-{os}-self-contained.{archive-extension}` and replace `{company}` with your company DNS prefix.
* Alpine uses [musl](https://en.wikipedia.org/wiki/Musl), while most Linux distributions use [glibc](https://en.wikipedia.org/wiki/GNU_C_Library). That is why Alpine has a separate artifact.
  {% endhint %}

## Downloading from NuGet <a href="#downloading-from-nuget" id="downloading-from-nuget"></a>

The agent is also published on [NuGet Gallery | sealights-technologies](https://www.nuget.org/profiles/sealights-technologies).

* Sealights.DotNet.Windows
* Sealights.DotNet.Linux
* Sealights.DotNet.Alpine

You can download the platform package that matches your environment.

## Sample scripts <a href="#sample-scripts-for-download" id="sample-scripts-for-download"></a>

### Download from NuGet <a href="#download-from-nuget-the-linux-agent-version-predefined-in-the-settings-page" id="download-from-nuget-the-linux-agent-version-predefined-in-the-settings-page"></a>

These examples download the package, extract it locally, and create a short `sl-dotnet-agent` path.

{% tabs %}
{% tab title="PowerShell" %}
{% code overflow="wrap" %}

```powershell
$SL_PACKAGE = "Sealights.DotNet.Windows"
$NUGET_URL = "https://www.nuget.org/api/v2/package"
$SL_VERSION = "3.13.0"

$packageName = "sealights-dotnet-windows-$SL_VERSION.nupkg"
$extractPath = "./sealights-dotnet-windows-$SL_VERSION"

Invoke-WebRequest -Uri "$NUGET_URL/$SL_PACKAGE/$SL_VERSION" -OutFile $packageName -UseBasicParsing
Expand-Archive -Path $packageName -DestinationPath $extractPath -Force
New-Item -ItemType SymbolicLink -Path "./sl-dotnet-agent" -Target "$extractPath/content" -Force | Out-Null

Write-Output "[Sealights] Installed version is: $(Get-Content ./sl-dotnet-agent/version.txt)"
```

{% endcode %}
{% endtab %}

{% tab title="Bash" %}
{% code overflow="wrap" %}

```bash
SL_PACKAGE="Sealights.DotNet.Linux"
NUGET_URL="https://www.nuget.org/api/v2/package"
SL_VERSION="3.13.0"

wget -nv -O sealights-dotnet-linux-$SL_VERSION.nupkg "$NUGET_URL/$SL_PACKAGE/$SL_VERSION"
unzip -oq sealights-dotnet-linux-$SL_VERSION.nupkg -d "./sealights-dotnet-linux-$SL_VERSION"
ln -s ./sealights-dotnet-linux-$SL_VERSION/content ./sl-dotnet-agent
echo "[Sealights] Installed version is: $(cat ./sl-dotnet-agent/version.txt)"
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Download from SeaLights <a href="#download-the-agent-for-windows-zip-archive" id="download-the-agent-for-windows-zip-archive"></a>

{% tabs %}
{% tab title="PowerShell" %}
{% code overflow="wrap" %}

```powershell
$global:ProgressPreference = "SilentlyContinue"
iwr -OutFile sealights-dotnet-agent.zip -UseBasicParsing -Uri https://agents.sealights.co/dotnetcore/latest/sealights-dotnet-agent-windows-self-contained.zip
Expand-Archive .\sealights-dotnet-agent.zip -DestinationPath sl-dotnet-agent -Force
Write-Output "[Sealights] .NET Agent version is: $(Get-Content .\sl-dotnet-agent\version.txt)"
```

{% endcode %}

{% hint style="info" %}
You can deploy the token as a file in the agent folder automatically via a command like:\
`Out-File -InputObject $SL_AGENT_TOKEN -NoNewline -Force (Join-Path .\sl-dotnet-agent\ "sltoken.txt")`\
This will allow you to save the token parameter from the agent's commands.
{% endhint %}

{% hint style="warning" %}
In some Windows configurations, it may be necessary for you to enforce a compatible SSL protocol\
`[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 -bor [Net.SecurityProtocolType]::Tls13`
{% endhint %}
{% endtab %}

{% tab title="Bash" %}
{% code overflow="wrap" %}

```bash
wget -nv -O sealights-dotnet-agent-linux.tar.gz https://agents.sealights.co/dotnetcore/latest/sealights-dotnet-agent-linux-self-contained.tar.gz
mkdir sl-dotnet-agent && tar -xzf ./sealights-dotnet-agent-linux.tar.gz --directory ./sl-dotnet-agent
echo "[Sealights] .NET Agent version is: $(cat ./sl-dotnet-agent/version.txt)"
```

{% endcode %}
{% endtab %}

{% tab title="Alpine Bash" %}
{% code overflow="wrap" %}

```bash
wget -nv -O sealights-dotnet-agent-alpine.tar.gz https://agents.sealights.co/dotnetcore/latest/sealights-dotnet-agent-alpine-self-contained.tar.gz
mkdir sl-dotnet-agent && tar -xzf ./sealights-dotnet-agent-alpine.tar.gz --directory ./sl-dotnet-agent
echo "[Sealights] .NET Agent version is: $(cat ./sl-dotnet-agent/version.txt)"
```

{% endcode %}
{% endtab %}
{% endtabs %}

### CI examples <a href="#ci-examples" id="ci-examples"></a>

Use these examples when you want to download the agent inside the pipeline itself.

{% tabs %}
{% tab title="Azure DevOps" %}
{% code title="azure-pipelines.yml" overflow="wrap" %}

```yaml
steps:
  - pwsh: |
      $ProgressPreference = "SilentlyContinue"
      Invoke-WebRequest `
        -Uri "https://agents.sealights.co/dotnetcore/latest/sealights-dotnet-agent-windows-self-contained.zip" `
        -OutFile "sealights-dotnet-agent.zip" `
        -UseBasicParsing
      Expand-Archive ".\sealights-dotnet-agent.zip" -DestinationPath ".\sl-dotnet-agent" -Force
      Write-Host "[Sealights] Installed version: $(Get-Content .\sl-dotnet-agent\version.txt)"
    displayName: Download SeaLights .NET Agent
```

{% endcode %}
{% endtab %}

{% tab title="GitHub Actions" %}
{% code title=".github/workflows/dotnet.yml" overflow="wrap" %}

```yaml
jobs:
  tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Download SeaLights .NET Agent
        shell: bash
        run: |
          wget -nv -O sealights-dotnet-agent-linux.tar.gz https://agents.sealights.co/dotnetcore/latest/sealights-dotnet-agent-linux-self-contained.tar.gz
          mkdir -p sl-dotnet-agent
          tar -xzf ./sealights-dotnet-agent-linux.tar.gz --directory ./sl-dotnet-agent
          echo "[Sealights] Installed version: $(cat ./sl-dotnet-agent/version.txt)"
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Retrieve the agent version selected in your Settings page <a href="#security" id="security"></a>

These examples retrieve the version selected in the dashboard settings page.

{% tabs %}
{% tab title="PowerShell" %}
{% code overflow="wrap" %}

```powershell
$SEALIGHTS_URL = "mydomain.sealights.co"
$headers = @{
    accept = "application/json"
    Authorization = "Bearer $env:SEALIGHTS_AGENT_TOKEN"
}
$version = (Invoke-RestMethod "https://$SEALIGHTS_URL/api/v2/agents/dotnet/recommended" -Headers $headers).agent.version
Write-Output "[Sealights] Selected .NET version in Dashboard settings is: $version"
```

{% endcode %}
{% endtab %}

{% tab title="Bash" %}
{% code overflow="wrap" %}

```bash
SEALIGHTS_URL="mydomain.sealights.co"

SL_VERSION=$(curl -s -X GET "https://$SEALIGHTS_URL/api/v2/agents/dotnet/recommended" -H "accept: application/json" -H "Authorization: Bearer $SEALIGHTS_AGENT_TOKEN" -L | jq -r .agent.version)
echo "[Sealights] Selected .NET version in Dashboard settings is: $SL_VERSION"
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Security <a href="#security" id="security"></a>

If you download and copy the agent manually, its files might get blocked by Windows OS.

You have two options to unblock them:

* Right-click both the `SL.DotNet.exe` and `SL.DotNet.dll` files and check the **Unblock** check box in the **security** section.
* Use this PowerShell command: `Get-ChildItem -Path 'C:\Sealights\agent\' -Recurse | Unblock-File`

{% hint style="info" %}
For more info, see: <https://mywindowshub.com/how-to-unblock-a-file-in-windows-10/>
{% endhint %}

<figure><img src="/files/n5538FAq49tkoQHo8aj6" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/.net-core-agent/downloading-the-.net-core-agent.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
