Teamscale .NET Profiler — Troubleshooting
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.
- 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.dllvs.Profiler64.dll)? Check whether the process runs in 32-bit or 64-bit mode. - IIS: Is "Load User Profile" set to
Truefor 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 to inspect a running process:
- Open Process Explorer and find the process. For IIS, look for the user mode worker process
w3wp.exe. - Right-click the process → Properties.
- In the Image tab, verify whether the process is 32-bit or 64-bit, and confirm it matches the profiler DLL variant you configured.
- In the Environment tab, verify that
COR_ENABLE_PROFILINGandCOR_PROFILERare present and set to the correct values. - 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.
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:0000000aA .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).
