Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
maxLevel7
printableminLevelfalse1
Note

All the commands below have the sltoken and sltokenfile flags as optional. They only need to be used if you have not placed the sltoken.txt file inside the agents folder (x86, x64 or both).

Creating a session ID

Standard Session ID

Code Block
SL.DotNet.exe config --appName <arg> --branchName <arg> --buildName <arg> --includeNamespace <arg> [--excludeNamespace <arg>] [--include <arg>] [--exclude <arg>] [--buildSessionId <arg> | --buildSessionIdFile <arg>] [--token  <arg> | --tokenFile <arg>] [--proxy <arg> [--proxyUsername <arg> --proxyPassword <arg>]] 

Parameter

Description

appName

Name of the application

branchName

The source branch of the application

buildName

The build label of the current build

includeNamespace

Comma-separated, key-sensitive list of namespaces to include in scan.
Supports wildcards (* = any string, ? = any character, space character is not allowed). For example: 'com.example.*,io.*.demo,com.?ello.world'

excludeNamespace

Comma-separated, key-sensitive list of packages to exclude from scan.
Supports wildcards (* = any string, ? = any character, space character is not allowed). For example: 'com.example.*,io.*.demo,com.?ello.world'

include

Comma-separated list of files to include in scan. Default: *.exe, *.dll
Supports wildcards (* = any string, ? = any character, space character is not allowed). For example: '*-with-dependencies.dll,bad-bad?.exe,*-source.dll'

Default: *.exe, *.dll

exclude

exclude

Comma-separated list of files to exclude from scan.

This is a regex so to include all sub directories and files use the .*

Supports wildcards (* = any string, ? = any character). For example: '*-with-dependencies.dll,bad-bad?.exe,*-source.dll'

buildSessionId

Optional: A user provided session ID

buildSessionIdFile

Optional: A user provided Build Session ID file.

token

Access token generated from the SeaLights server

tokenFile

Path to file containing the access token generated from the SeaLights server

proxy

Address of proxy to run connection through
To use the system proxy just provide the value 'system'

proxyUsername

The proxy username if needed

proxyPassword

The proxy password if needed

...

Pull Request Session ID

Code Block
SL.DotNet.exe prepareForMsBuild {--buildSessionId <arg> | --buildSessionIdFile <arg>} --baseDir <arg> --ignoreGeneratedCode true [--token   prConfig --appName <arg> --pullRequestNumber <arg> --targetBranch <arg> --latestCommit <arg> --repositoryUrl <arg> --includeNamespace <arg> [--excludeNamespace <arg>] [--include <arg>] [--exclude <arg>] [--buildSessionId <arg> | --tokenFilebuildSessionIdFile <arg>] [--token  <arg> | --tokenFile <arg>] [--proxy <arg> [--proxyUsername <arg> --proxyPassword <arg>]] 

Parameter

Description

token

Access token

Parameter

Description

token

Access token generated from the SeaLights server

tokenFile

Path to file containing the access token generated from the SeaLights server

buildSessionId

Session ID of configuration created

buildSessionIdFile

Path to file containing the Session ID of configuration created

baseDir

Base path where your solution file is

Scanning a build

Info

The project must contain all the PDB files!

Code Block
SL.DotNet.exe scan {--buildSessionId <arg> | --buildSessionIdFile <arg>} --workspacePath <arg> --ignoreGeneratedCode true [--firstModule {true|false}] [--uniqueModuleId <arg>] [--baseDir <arg>] [--scm <arg>] [--token  <arg> | --tokenFile <arg>] [--proxy <arg> [--proxyUsername <arg> --proxyPassword <arg>]]

appName

Name of the application

pullRequestNumber

The number assigned to the Pull Request from the source control

targetBranch

The branch to which this PR will be merged into (already reported to SeaLights)

latestCommit

The full SHA of the last commit made to the Pull Request

repoUrl

The pull request URL for the PR to be scanned, up until the section before the pullRequestNumber value

includeNamespace

Comma-separated, key-sensitive list of namespaces to include in scan.
Supports wildcards (* = any string, ? = any character, space character is not allowed). For example: 'com.example.*,io.*.demo,com.?ello.world'

excludeNamespace

Comma-separated, key-sensitive list of packages to exclude from scan.
Supports wildcards (* = any string, ? = any character, space character is not allowed). For example: 'com.example.*,io.*.demo,com.?ello.world'

include

Comma-separated list of files to include in scan. Default: *.exe, *.dll
Supports wildcards (* = any string, ? = any character, space character is not allowed). For example: '*-with-dependencies.dll,bad-bad?.exe,*-source.dll'

exclude

Comma-separated list of files to exclude from scan.
Supports wildcards (* = any string, ? = any character). For example: '*-with-dependencies.dll,bad-bad?.exe,*-source.dll'

buildSessionId

Optional: A user provided session ID

buildSessionIdFile

Optional: A user provided Build Session ID file.

token

Access token generated from the SeaLights server

tokenFile

Path to file containing the access token generated from the SeaLights server

buildSessionId

proxyPassword

The proxy password if needed

proxy

Session ID of configuration created

buildSessionIdFile

Path to file containing the Session ID of configuration created

workspacePath

Path to the source workspace

firstModule

Must be provided when scanning the first module

uniqueModuleId

A unique module ID to be used for seperate modules

baseDir

Base path where all relative paths should start from. By default the agent searches for the solution file and uses its path for this value

hashingAlgorithm

Hashing algorithm to use. Available options are md5 (default), sha1, sha256, sha384, sha512 

scm

The SCM that is used in order to provide integration with. Values: auto, git, none

proxy

Address of proxy to run connection through
To use the system proxy just provide the value 'system'

proxyUsername

The proxy username if needed

Address of proxy to run connection through
To use the system proxy just provide the value 'system'

proxyUsername

The proxy username if needed

proxyPassword

The proxy password if needed

Preparing a build for MSBuild

Code Block
SL.DotNet.exe prepareForMsBuild {--buildSessionId <arg> | --buildSessionIdFile <arg>} --baseDir <arg> --ignoreGeneratedCode true [--token  <arg> | --tokenFile <arg>] 

Parameter

Description

token

Access token generated from the SeaLights server

tokenFile

Path to file containing the access token generated from the SeaLights server

buildSessionId

Session ID of configuration created

buildSessionIdFile

Path to file containing the Session ID of configuration created

baseDir

Base path where your solution file is

Scanning a build

Info

The project must contain all the PDB files!

Code Block
SL.DotNet.exe scan {--buildSessionId <arg> | --buildSessionIdFile <arg>} --workspacePath <arg> --ignoreGeneratedCode true [--firstModule {true|false}] [--uniqueModuleId <arg>] [--baseDir <arg>] [--scm <arg>] [--token  <arg> | --tokenFile <arg>] [--proxy <arg> [--proxyUsername <arg> --proxyPassword <arg>]]

Parameter

Description

token

Access token generated from the SeaLights server

tokenFile

Path to file containing the access token generated from the SeaLights server

buildSessionId

Session ID of configuration created

buildSessionIdFile

Path to file containing the Session ID of configuration created

workspacePath

Path to the source workspace

firstModule

Must be provided when scanning the first module

uniqueModuleId

A unique module ID to be used for seperate modules

baseDir

Base path where all relative paths should start from. By default the agent searches for the solution file and uses its path for this value

hashingAlgorithm

Hashing algorithm to use. Available options are md5 (default), sha1, sha256, sha384, sha512 

scm

The SCM that is used in order to provide integration with. Values: auto, git, none

proxy

Address of proxy to run connection through
To use the system proxy just provide the value 'system'

proxyUsername

The proxy username if needed

proxyPassword

The proxy password if needed

ExtraScanDir

Scan additional folder to collect more runtime components (.git/dll/exe ) for scanning. The path is an absolute path.

extraDbgSearchDirs

Comma-separated list of absolute paths to the folders where the agent will recursively search for *.pdb files

Ending multi-modules scan

Code Block
SL.DotNet.exe reportBuildStatus {--buildSessionId <arg> | --buildSessionIdFile <arg>} --success <true|false> [--message <arg>] [--duration <arg>] [--token  <arg> | --tokenFile <arg>] [--proxy <arg> [--proxyUsername <arg> --proxyPassword <arg>]]

Parameter

Description

token

Access token generated from the SeaLights server

tokenFile

Path to file containing the access token generated from the SeaLights server

buildSessionId

Session ID of configuration created

buildSessionIdFile

Path to file containing the Session ID of configuration created

success

Indicates that the build succeeded (considered failed if not specified)

message

Additional build status message to report (optional)

duration

Build duration in milliseconds (optional)

Starting a test stage

Code Block
SL.DotNet.exe startExecution {--buildSessionId <arg> | --buildSessionIdFile <arg>} --testStage <arg> [--labId <arg>] [--token  <arg> | --tokenFile <arg>] [--proxy <arg> [--proxyUsername <arg> --proxyPassword <arg>]]

Parameter

Description

token

Access token generated from the SeaLights server

tokenFile

Path to file containing the access token generated from the SeaLights server

buildSessionId

Session ID of configuration created

buildSessionIdFile

Path to file containing the Session ID of configuration created

testStage

Name of the test stage

labId

Unique ID for a set of test labs in case multiple labs are running similtaniously

proxy

Address of proxy to run connection through. To use the system proxy just provide the value 'system'

proxyUsername

The proxy username if needed

proxyPassword

The proxy password if needed

Upload report files

Code Block
SL.DotNet.exe uploadTestReport {--buildSessionId <arg> | --buildSessionIdFile <arg>} --testStage <arg> --report <arg> [--labId <arg>] [--token  <arg> | --tokenFile <arg>] [proxy <arg> [--proxyUsername <arg> --proxyPassword <arg>]]

Parameter

Description

token

Access token generated from the SeaLights server

tokenFile

Path to file containing the access token generated from the SeaLights server

buildSessionId

Session ID of configuration created

buildSessionIdFile

Path to file containing the Session ID of configuration created

testStage

Name of the test stage

report

Path to report file or directory containing all the valid reports (Non recursive). Supported formats are MSTest (TRX files), xUnit.Net and NUnit (XML files).

labId

Unique ID for a set of test labs in case multiple labs are running simultaneously

proxy

Address of proxy to run connection through. To use the system proxy just provide the value 'system'.

proxyUsername

The proxy username if needed

proxyPassword

The proxy password if needed

Ending a test stage

Code Block
SL.DotNet.exe endExecution {--buildSessionId <arg> | --buildSessionIdFile <arg>} --testStage <arg> [--labId <arg>] [--token  <arg> | --tokenFile <arg>] [--proxy <arg> [--proxyUsername <arg> --proxyPassword <arg>]]

Parameter

Description

token

Access token generated from the SeaLights server

tokenfile

Path to file containing the access token generated from the SeaLights server

buildsessionid

Session ID of configuration created

buildsessionidfile

Path to file containing the Session ID of configuration created

labId

Unique ID for a set of test labs in case multiple labs are running similtaniously

proxy

Address of proxy to run connection through
To use the system proxy just provide the value 'system'

proxyUsername

The proxy username if needed

proxyPassword

The proxy password if needed

Starting the test listener

For a single process to be run with the SeaLights agent as a test listener in order to capture the tests footprints.

Code Block
SL.DotNet.exe testListener {--buildSessionId <arg> | --buildSessionIdFile <arg>} --target <arg> [--workingDir <arg>] [--targetArgs <arg>] [--labId <arg>] [--token  <arg> | --tokenFile <arg>] [--proxy <arg> [--proxyUsername <arg> --proxyPassword <arg>]] [--profilerRegistrationMethod <path32|path64>]

Parameter

Description

token

Access token generated from the SeaLights server

tokenFile

Path to file containing the access token generated from the SeaLights server

buildSessionId

Session ID of configuration created

buildSessionIdFile

Path to file containing the Session ID of configuration created

target

Name of the application to run with the test listener

workingDir

Path to working directory. Current working directory will be used if not specified

profilerRegistrationMethod

Sets the COM32 profiler DLL registration method. 

targetArgs

Command line arguments to pass the target application

labId

Unique ID for a set of test labs in case multiple labs are running simultaneously

proxy

Address of proxy to run connection through
To use the system proxy just provide the value 'system'

proxyUsername

The proxy username if needed

proxyPassword

The proxy password if needed

Starting Background test listener

Code Block
SL.DotNet.exe startBackgroundTestListener {--buildSessionId <arg> | --buildSessionIdFile <arg>} --testListenerSessionKey <arg> [--labId <arg>] [--token  <arg> | --tokenFile <arg>] [--proxy <arg> [--proxyUsername <arg> --proxyPassword <arg>]]

Parameter

Description

token

Access token generated from the SeaLights server

tokenFile

Path to file containing the access token generated from the SeaLights server

buildSessionId

Session ID of configuration created

buildSessionIdFile

Path to file containing the Session ID of configuration created

testListenerSessionKey

A random alphanumeric ID (%RANDOM% in command line)

This ID needs to be passed to any process that you want to capture cover

labId

Unique ID for a set of test labs in case multiple labs are running simultaneously

proxy

Address of proxy to run connection through
To use the system proxy just provide the value 'system'

proxyUsername

The proxy username if needed

proxyPassword

The proxy password if needed

Running background processes

You need to run your process with the following environment variables:

Code Block
Cor_Profiler={01CA2C22-DC03-4FF5-8350-59E32A3536BA}
Cor_Enable_Profiling=1
Cor_Profiler_Path={ SL.DotNet.ProfilerLib_x64.dll | SL.DotNet.ProfilerLib_x86.dll }
COR_PROFILER_PATH_32=SL.DotNet.ProfilerLib_x86.dll
COR_PROFILER_PATH_64=SL.DotNet.ProfilerLib_x64.dll
SeaLights_CollectorId=<testListenerSessionKey>

Parameter

Description

Cor_Profiler

{01CA2C22-DC03-4FF5-8350-59E32A3536BA}

Cor_Enable_Profiling

1

Cor_Profiler_Path

For .NET 4.5+ :
Path to the SeaLights profiler DLL.
Either SL.DotNet.ProfilerLib_x64.dll or SL.DotNet.ProfilerLib_x86.dll depending on your processes architecture

COR_PROFILER_PATH_32
COR_PROFILER_PATH_64

For  .NET 4.6+ :
Path to the SeaLights profiler DLL.
Both should be set and the correct one will be depending on the processes architechture

SL_CollectorId

A random alphanumeric ID that was provided during the startBackgroundTestListener

SL_LogLevel

Optional: Level of logs to generate - Default is 0 (none), Fatal=1, Error=4, Debug=6, All=999

SL_LogDir

Optional: Folder to save log files in

Stop Background test listener

Code Block
SL.DotNet.exe stopBackgroundTestListener {--buildSessionId <arg> | --buildSessionIdFile <arg>} --testListenerSessionKey <arg> [--token  <arg> | --tokenFile <arg>] [--proxy <arg> [--proxyUsername <arg> --proxyPassword <arg>]]

Parameter

Description

token

Access token generated from the SeaLights server

tokenFile

Path to file containing the access token generated from the SeaLights server

buildSessionId

Session ID of configuration created

buildSessionIdFile

Path to file containing the Session ID of configuration created

testListenerSessionKey

A random alphanumeric ID that was provided during the startBackgroundTestListener

proxy

Address of proxy to run connection through
To use the system proxy just provide the value 'system'

proxyUsername

The proxy username if needed

proxyPassword

The proxy password if needed

Starting the Service test listener

Code Block
SL.DotNet.exe startCollectorServiceSession {--buildSessionId <arg> | --buildSessionIdFile <arg>} --processName <arg> [--processTag <arg>] [--includeChildProcesses] [--machine <host>] [--labId <arg>] [--token  <arg> | --tokenFile <arg>] [--proxy <arg> [--proxyUsername <arg> --proxyPassword <arg>]]

Parameter

Description

token

Access token generated from the SeaLights server

tokenFile

Path to file containing the access token generated from the SeaLights server

buildSessionId

Session ID of configuration created

buildSessionIdFile

Path to file containing the Session ID of configuration created

processName

The executable name of the services process.

For instance IIS is: w3wp.exe

processTag

The application pool identity tag in IIS

For non IIS services this should not be provided

includeChildProcesses

Should be set if the service spawns child processes and coverage needs to be captured from them

machine

Remote machine to start the collector service on

labId

Unique ID for a set of test labs in case multiple labs are running simultaneously

proxy

Address of proxy to run connection through
To use the system proxy just provide the value 'system'

proxyUsername

The proxy username if needed

proxyPassword

The proxy password if needed

Stopping the Service test listener

Code Block
SL.DotNet.exe stopCollectorServiceSession {--buildSessionId <arg> | --buildSessionIdFile <arg>} --processName <arg> [--processTag <arg>] [--includeChildProcesses] [--machine <host>] [--labId <arg>] [--token  <arg> | --tokenFile <arg>] [--proxy <arg> [--proxyUsername <arg> --proxyPassword <arg>]]

Parameter

Description

token

Access token generated from the SeaLights server

tokenFile

Path to file containing the access token generated from the SeaLights server

buildSessionId

Session ID of configuration created

buildSessionIdFile

Path to file containing the Session ID of configuration created

processName

The executable name of the services process.

For instance IIS is: w3wp.exe

processTag

The application pool identity tag in IIS

For non IIS services this should not be provided

includeChildProcesses

Should be set if the service spawns child processes and coverage needs to be captured from them

machine

Remote machine to start the collector service on

labId

Unique ID for a set of test labs in case multiple labs are running simultaneously

proxy

Address of proxy to run connection through
To use the system proxy just provide the value 'system'

proxyUsername

The proxy username if needed

proxyPassword

The proxy password if needed

Logging

Agents Commands

In order to enable logs when executing direct agent commands, you can set the following parameters with any of the above commands

Parameter

Description

logEnabled

Set to true to enable logs

debugMode

Set to true to enable enhanced logs (prepareForMsbuild)

logAppendConsole

Set to true to enable log output to the console

logAppendFile

Set to true to enable log output to a file

logFilename

Provide the name of the log file (Collector)

logFileCount

Limit the number of log files to create. Default: 10

logSizeLimit

Limit the size of the log file. Default: 10*1024 KB

profilerLogDir

Path for the Profiler log file to be created in.

profilerLogLevel

Level of logs from the Profiler to generate as a Integer value: Default is 0 (none), Fatal=1, Error=4, Debug=6, All=999

IIS Collector Service and Background Listener

In order to enable logs, you can add the following environment variables to the registry in addition to the regular variables set for the Profiler as explained in the section Running background processes above

Parameter

Description

SL_LogLevel

Level of logs to generate as a Integer value: Default is 0 (none), Fatal=1, Error=4, Debug=6, All=999

SL_LogDir

Folder to save log files in.

Note

When enabling logs for the IIS Collector Service, please make sure to:

  1. Add the above parameters into the Multi-String value Environment where other SL.DotNet agent variables were set in the Registry (System\CurrentControlSet\Services\W3SVC and System\CurrentControlSet\Services\WAS)

  2. Execute the iisreset /restart command for the changes to take effect