---
url: /reference/coverage-profilers/teamscale-dotnet-profiler/troubleshooting.md
---
# Teamscale .NET Profiler — Troubleshooting

\[\[toc]]

## No trace files are created

Check the following:

* Are there any related errors in the Windows Event Log? The .NET runtime logs an error there if loading the profiler fails (meaning the environment variables were set but the profiler crashed during initialization).
* Are the environment variables set correctly? See [Installation](../#installation).
* Are the environment variables set for the correct user account?
* Does the application process have read access to the profiler DLLs?
* Does the application process have write access to the trace output directory (`COR_PROFILER_TARGETDIR`)?
* Did you choose the correct DLL (`Profiler32.dll` vs. `Profiler64.dll`)? Check whether the process runs in 32-bit or 64-bit mode.
* IIS: Is "Load User Profile" set to `True` for the application pool?
* IIS: Did you recycle the application pool after setting environment variables?

If the application fails to start at all, check `C:\Users\Public\profiler_debug.<pid>.log` (where `<pid>` is the process ID) for crash details and stack traces. The `attach.log` file in the directory of the profiler configuration file (`Profiler.yml`) records which processes the profiler attached to.

### Verify environment variables are visible to the process

Use the free [Microsoft Process Explorer](https://technet.microsoft.com/en-gb/sysinternals/bb896653.aspx) to inspect a running process:

1. Open Process Explorer and find the process. For IIS, look for the user mode worker process `w3wp.exe`.
2. Right-click the process → Properties.
3. In the **Image** tab, verify whether the process is 32-bit or 64-bit, and confirm it matches the profiler DLL variant you configured.
4. In the **Environment** tab, verify that `COR_ENABLE_PROFILING` and `COR_PROFILER` are present and set to the correct values.
5. Check the user account under which the process runs and confirm that user has write access to the trace output directory.

### Test with a minimal setup

If nothing else helps, test with a minimal configuration: enable profiling for all processes and set `COR_PROFILER_TARGETDIR` to `C:\Users\Public`. Open a **new** shell (so that the environment variables take effect) and start `powershell.exe`. A trace file should appear in `C:\Users\Public`.

If that works, progressively add options one by one until you reproduce the configuration for your actual application.

## Profiler seems to ignore configuration options

The profiler looks up option names in snake case.
A camel case spelling such as `lightMode` matches no option.
Invalid option names are logged to the trace `.txt` files as `Warn=` warning log lines.

The [Upload Daemon options](../config-reference/#upload-daemon-options) behave differently: an unknown key there aborts config parsing with an error, which the daemon logs to `UploadDaemon.log`.

## Debugging profiler crashes

If `profiler_debug.<pid>.log` does not contain enough information, generate a minidump for analysis with WinDbg. Create the following as a `.reg` file and apply it:

```
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps]
"DumpFolder"="C:\\Users\\Public"
"DumpType"=dword:00000001
"DumpCount"=dword:0000000a
```

A `.dmp` file will appear in `C:\Users\Public` on the next crash. Set `DumpType` to `2` for a full heap dump (produces a larger file that includes the entire program heap).
