When NCover.Reporting is run under the Local System account, such as by a script, by a build server, or as part of an automated build or testing process, it may generate an error and fail to create reports.

Common Scenarios

Users who have reported this issue to us are commonly using NCover with TeamCity's .NET Coverage feature, and have set TeamCity to run under the Local System account. In such a scenario, NCover.Reporting fails to generate HTML or XML reports and users find errors in the TeamCity build log related to NCover.Reporting.

Cause

The cause of this issue relates to the Local System's temporary file path and %USERPROFILE% environment variables. When NCover.Reporting loads a coverage file to process, several temporary files are created in the temporary folder specified by the user's environment variables. When NCover.Reporting is run under the Local System account, the temporary file path is sometimes not present, and creation of the reports fails.

Suggested Resolution

If you are experiencing errors when using NCover.Reporting under the Local System account, you should verify that the temporary file path specified for the Local System is valid. Assuming that environment variables have their default settings and that Windows is installed on the 'C' drive, the following paths should exist:

In most cases, the "Temp" folder is missing and should be created. If creating the "Temp" folder does not correct this issue, or the folder already exists but the issue continues to occur, please contact our support team.