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 variable | Value | Description |
|---|---|---|
COR_ENABLE_PROFILING | 1 | Enables the profiler |
COR_PROFILER | {DD0A1BB6-11CE-11DD-8EE8-3F9E55D89593} | GUID identifying the profiler DLL |
COR_PROFILER_PATH_32 | Path | Path to Profiler32.dll |
COR_PROFILER_PATH_64 | Path | Path to Profiler64.dll |
.NET Core
| Environment variable | Value | Description |
|---|---|---|
CORECLR_ENABLE_PROFILING | 1 | Enables the profiler |
CORECLR_PROFILER | {DD0A1BB6-11CE-11DD-8EE8-3F9E55D89593} | GUID identifying the profiler DLL |
CORECLR_PROFILER_PATH_32 | Path | Path to Profiler32.dll |
CORECLR_PROFILER_PATH_64 | Path | Path to Profiler64.dll |
Config file path
| Environment variable | Default | Description |
|---|---|---|
COR_PROFILER_CONFIG | Profiler.yml next to DLLs | Path to the YAML configuration file |
Profiler Options
Set under the profiler: key in each match section of the configuration file.
match:
# ...
profiler:
enabled: true
targetdir: 'C:\Users\Public\Traces'
upload_daemon: trueEach option can also be set as an environment variable: COR_PROFILER_ + the option name uppercased (e.g. targetdir → COR_PROFILER_TARGETDIR). Environment variables override the config file.
| YAML key | Env var | Default | Description |
|---|---|---|---|
enabled | — | true | Enable or disable profiling for processes matching this section |
targetdir | COR_PROFILER_TARGETDIR | C:\Users\Public | Directory where trace files are written. C:\Users\Public is writable by all Windows user accounts by default. |
light_mode | COR_PROFILER_LIGHT_MODE | true | Enables ultra-light mode by disabling re-jitting of assemblies. Disable only if you use the Native Image Cache. |
assembly_paths | COR_PROFILER_ASSEMBLY_PATHS | true | Records assembly paths in trace files. Required for @AssemblyDir to work in the Upload Daemon — enabled by default for this reason. |
assembly_file_version | COR_PROFILER_ASSEMBLY_FILE_VERSION | false | Prints the file and product version of loaded assemblies in trace files. |
eagerness | COR_PROFILER_EAGERNESS | 0 | When > 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_daemon | COR_PROFILER_UPLOAD_DAEMON | false | Enables the Upload Daemon |
dump_environment | COR_PROFILER_DUMP_ENVIRONMENT | false | Prints 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.
match:
# ...
uploader:
pdbDirectory: '@AssemblyDir'
revisionFile: 'C:\my\application\revision.txt'
uploadIntervalInMinutes: 60They must be set in the configuration file and cannot be specified as environment variables.
| YAML key | Default | Description |
|---|---|---|
pdbDirectory | required | Directory containing PDB files used for coverage conversion. @AssemblyDir resolves to the directory of each loaded assembly (requires assembly_paths: true). |
revisionFile | required | Path 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.include | all assemblies | Glob patterns for assembly names to include. * = any characters, ? = one character. Matched against name without extension. |
assemblyPatterns.exclude | none | Glob patterns for assembly names to exclude. |
uploadIntervalInMinutes | 5 | How often finished traces are uploaded. Set to 0 to disable scheduled uploads (manual-only mode). |
disableSslValidation | true | Disables SSL certificate validation. Set to false in production. Disabled by default to simplify setup in environments with self-signed certificates. |
mergeLineCoverage | true | Merges 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:
| Format | Example | Description |
|---|---|---|
revision: HASH | revision: abc123def456 | VCS revision (Git SHA1 or TFS changeset ID) |
timestamp: BRANCH:MS | timestamp: master:1672531200000 | Unix timestamp in milliseconds with branch name |
Upload Destinations
Determine where finished trace files are uploaded to. Configure exactly one destination under uploader:.
Teamscale
uploader:
teamscale:
url: 'http://teamscale.example.com'
username: 'build'
accessKey: 'your-access-key'
project: 'my-project'
partition: 'Manual Tests'| YAML key | Description |
|---|---|
teamscale.url | HTTP(S) URL of the Teamscale instance |
teamscale.username | Teamscale username |
teamscale.accessKey | User's access key |
teamscale.project | Teamscale project alias or ID |
teamscale.partition | Target 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
uploader:
artifactory:
url: 'https://yourinstance.jfrog.io/artifactory/some/path'
apiKey: 'somekey'
partition: 'Manual Tests'| YAML key | Description |
|---|---|
artifactory.url | Artifactory repository URL |
artifactory.apiKey | API key (preferred) |
artifactory.username | Username (alternative to apiKey) |
artifactory.password | Password (alternative to apiKey) |
artifactory.partition | Partition name for Teamscale's Artifactory connector |
artifactory.pathSuffix | Optional path appended to the URL |
Network share
uploader:
directory: '\\yourserver.localdomain\coverage'| YAML key | Description |
|---|---|
directory | Path to a network share or local directory |
Azure File Storage
uploader:
azureFileStorage:
connectionString: 'DefaultEndpointsProtocol=https;AccountName=...;AccountKey=...;'
shareName: 'my-share'
directory: 'log/file/path'| YAML key | Description |
|---|---|
azureFileStorage.connectionString | Azure storage connection string |
azureFileStorage.shareName | Azure file share name |
azureFileStorage.directory | Directory 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 key | Default | Description |
|---|---|---|
archivePurgingThresholdsInDays.uploadedTraces | indefinite | Days to retain successfully uploaded traces. 0 = purge immediately after processing. |
archivePurgingThresholdsInDays.emptyTraces | indefinite | Days to retain empty traces (no coverage recorded). |
archivePurgingThresholdsInDays.incompleteTraces | indefinite | Days to retain traces that could not be processed. |
archiveLineCoverage | false | Write generated coverage files to disk for debugging. These files are never purged automatically. |
Example:
archivePurgingThresholdsInDays:
uploadedTraces: 7
emptyTraces: 3
incompleteTraces: 3