Downloading the Legacy .NET agent files



Agent Files

See 'Generating an Agent token' for instructions on how to generate a token

Download them from: http://agents.sealights.co/SL.DotNet/SL.DotNet-2.0.1.810.zip

  • There are two folders: one for 32-bit and the other for 64-bit architectures.
    You should use the agent from the correct folder depending on architecture of the application you want to gather coverage from.

  • Place the sltoken.txt file, downloaded from the SeaLights dashboard, in both the x64 and x86 folders.
    The agent will use it automatically and then you will not need to provide this in the command line options.

It is recommended to extract them in a folders without the version number, so that if in the future you update the agent, you will not need to change you build scripts

Sample commands for download

The sample Powershell commands below retrieve the version you have defined in your settings and expand it locally.

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $global:ProgressPreference = "SilentlyContinue" #Disable Progress bar to speed up download and expand $sldomain="mycompany.sealights.co" #Update with your customer domain $slToken="$(Get-Content sltoken.txt)" #Prefer a credential Environment variable for the token Write-Output "Retrieve version from Sealights settings..." $slHeader=@{'Accept'='application/json'; 'Authorization'="Bearer $slToken"} $agentversion = ((iwr -Uri https://$sldomain/api/v2/agents/dotnet/recommended -UseBasicParsing -Headers $slHeader).Content | ConvertFrom-Json | Select-Object agent).agent.version Write-Output "Download Sealights DotNet agent..." iwr -OutFile sealights-dotnet-agent.zip -UseBasicParsing -Uri http://agents.sealights.co/SL.DotNet/SL.DotNet-$agentversion.zip Write-Output "Expanding downloaded archive..." Expand-Archive .\sealights-dotnet-agent.zip -DestinationPath SL.DotNet -Force Write-Output "Sealights agent version used is: $(Get-Content .\SL.DotNet\version.txt)"

You can deploy the token file to the x86 and x64 folder automatically via a command like:
Get-ChildItem -Directory -Path .\SL.DotNet\ | Foreach-Object { $slagenttoken | Out-File -NoNewline -Force (Join-Path $_.FullName "sltoken.txt") }

Security

Depending on how you downloaded and copied the agents, they might get blocked by Windows OS.
To unblock them, right click both the SL.DotNet.exe files (x86 & x64) and check the Unblock check box in the security section