Skip to content

Configuration Reference

Complete reference for all Teamscale .NET Profiler and Upload Daemon configuration options.


Registration Variables

These variables register the profiler with the .NET runtime. They must be set as environment variables and cannot be specified in the configuration file.

.NET Framework

Environment variableValueDescription
COR_ENABLE_PROFILING1Enables the profiler
COR_PROFILER{DD0A1BB6-11CE-11DD-8EE8-3F9E55D89593}GUID identifying the profiler DLL
COR_PROFILER_PATH_32PathPath to Profiler32.dll
COR_PROFILER_PATH_64PathPath to Profiler64.dll

.NET Core

Environment variableValueDescription
CORECLR_ENABLE_PROFILING1Enables the profiler
CORECLR_PROFILER{DD0A1BB6-11CE-11DD-8EE8-3F9E55D89593}GUID identifying the profiler DLL
CORECLR_PROFILER_PATH_32PathPath to Profiler32.dll
CORECLR_PROFILER_PATH_64PathPath to Profiler64.dll

Config file path

Environment variableDefaultDescription
COR_PROFILER_CONFIGProfiler.yml next to DLLsPath to the YAML configuration file

Profiler Options

Set under the profiler: key in each match section of the configuration file.

yaml
match:

  # ...

  profiler:
    enabled: true
    targetdir: 'C:\Users\Public\Traces'
    upload_daemon: true

Each option can also be set as an environment variable: COR_PROFILER_ + the option name uppercased (e.g. targetdirCOR_PROFILER_TARGETDIR). Environment variables override the config file.

YAML keyEnv varDefaultDescription
enabledtrueEnable or disable profiling for processes matching this section
targetdirCOR_PROFILER_TARGETDIRC:\Users\PublicDirectory where trace files are written. C:\Users\Public is writable by all Windows user accounts by default.
light_modeCOR_PROFILER_LIGHT_MODEtrueEnables ultra-light mode by disabling re-jitting of assemblies. Disable only if you use the Native Image Cache.
assembly_pathsCOR_PROFILER_ASSEMBLY_PATHStrueRecords assembly paths in trace files. Required for @AssemblyDir to work in the Upload Daemon — enabled by default for this reason.
assembly_file_versionCOR_PROFILER_ASSEMBLY_FILE_VERSIONfalsePrints the file and product version of loaded assemblies in trace files.
eagernessCOR_PROFILER_EAGERNESS0When > 0, writes trace data to disk after every N method calls instead of waiting for process shutdown. Use in environments where the .NET runtime is killed rather than shut down gracefully. Combine with light_mode.
upload_daemonCOR_PROFILER_UPLOAD_DAEMONfalseEnables the Upload Daemon
dump_environmentCOR_PROFILER_DUMP_ENVIRONMENTfalsePrints all environment variables of the profiled process in trace files

Upload Daemon Options

Set under the uploader: key in each match section of the configuration file.

yaml
match:

  # ...

  uploader:
    pdbDirectory: '@AssemblyDir'
    revisionFile: 'C:\my\application\revision.txt'
    uploadIntervalInMinutes: 60

They must be set in the configuration file and cannot be specified as environment variables.

YAML keyDefaultDescription
pdbDirectoryrequiredDirectory containing PDB files used for coverage conversion. @AssemblyDir resolves to the directory of each loaded assembly (requires assembly_paths: true).
revisionFilerequiredPath to a file containing the code revision of the deployed build. @AssemblyDir scans assembly directories in load order for the first match. See revision file formats.
assemblyPatterns.includeall assembliesGlob patterns for assembly names to include. * = any characters, ? = one character. Matched against name without extension.
assemblyPatterns.excludenoneGlob patterns for assembly names to exclude.
uploadIntervalInMinutes5How often finished traces are uploaded. Set to 0 to disable scheduled uploads (manual-only mode).
disableSslValidationtrueDisables SSL certificate validation. Set to false in production. Disabled by default to simplify setup in environments with self-signed certificates.
mergeLineCoveragetrueMerges all coverage going to the same destination into a single file before upload, reducing upload count and disk usage.

Revision file formats

The revision file contains a single line in one of these formats:

FormatExampleDescription
revision: HASHrevision: abc123def456VCS revision (Git SHA1 or TFS changeset ID)
timestamp: BRANCH:MStimestamp: master:1672531200000Unix timestamp in milliseconds with branch name

Upload Destinations

Determine where finished trace files are uploaded to. Configure exactly one destination under uploader:.

Teamscale

yaml
uploader:
  teamscale:
    url: 'http://teamscale.example.com'
    username: 'build'
    accessKey: 'your-access-key'
    project: 'my-project'
    partition: 'Manual Tests'
YAML keyDescription
teamscale.urlHTTP(S) URL of the Teamscale instance
teamscale.usernameTeamscale username
teamscale.accessKeyUser's access key
teamscale.projectTeamscale project alias or ID
teamscale.partitionTarget partition

File Storage Upload

In case the .NET Profiler is unable to directly upload coverage to Teamscale, you can also upload it to your file storage solution.

Artifactory

yaml
uploader:
  artifactory:
    url: 'https://yourinstance.jfrog.io/artifactory/some/path'
    apiKey: 'somekey'
    partition: 'Manual Tests'
YAML keyDescription
artifactory.urlArtifactory repository URL
artifactory.apiKeyAPI key (preferred)
artifactory.usernameUsername (alternative to apiKey)
artifactory.passwordPassword (alternative to apiKey)
artifactory.partitionPartition name for Teamscale's Artifactory connector
artifactory.pathSuffixOptional path appended to the URL

Network share

yaml
uploader:
  directory: '\\yourserver.localdomain\coverage'
YAML keyDescription
directoryPath to a network share or local directory

Azure File Storage

yaml
uploader:
  azureFileStorage:
    connectionString: 'DefaultEndpointsProtocol=https;AccountName=...;AccountKey=...;'
    shareName: 'my-share'
    directory: 'log/file/path'
YAML keyDescription
azureFileStorage.connectionStringAzure storage connection string
azureFileStorage.shareNameAzure file share name
azureFileStorage.directoryDirectory within the share

Archiving Options

Detemine when processed trace files are archived to a separate folder. Set at the top level of the configuration file (not inside a match section).

YAML keyDefaultDescription
archivePurgingThresholdsInDays.uploadedTracesindefiniteDays to retain successfully uploaded traces. 0 = purge immediately after processing.
archivePurgingThresholdsInDays.emptyTracesindefiniteDays to retain empty traces (no coverage recorded).
archivePurgingThresholdsInDays.incompleteTracesindefiniteDays to retain traces that could not be processed.
archiveLineCoveragefalseWrite generated coverage files to disk for debugging. These files are never purged automatically.

Example:

yaml
archivePurgingThresholdsInDays:
  uploadedTraces: 7
  emptyTraces: 3
  incompleteTraces: 3