UnauthorizedAccessException when TestStand Generates a Report

Updated May 30, 2018

Reported In

Software

  • TestStand

Operating System

  • Windows

Issue Details

When I run my TestStand sequence, I receive the following .NET exception:

System.UnauthorizedAccessException:Access is denied -->System.ComponentModel.Win32Exception:Access is Denied 

When I enable On-The-Fly Reporting, this happens before MainSequence is called. When I disable On-The-Fly Reporting, this happens at the end of execution when the report is generated. This happens whether I am running Single Pass or Test UUTs but does not happen when I select Run MainSequence the error does not happen.

Solution

This exception is caused by TestStand lacking permissions to write to the report file path. You can find your report file path in TestStand by clicking Configure >> Result Processing >> Options (hammer and wrench icon) >> Report File Pathname. If TestStand is writing to a protected path, it will need to be run by a user with permissions to access that path. In some cases, this will also require running TestStand as administrator (even if the user has an administrator account).

Additional Information

On-The-Fly Reporting creates the report file before MainSequence is called, which is why the error occurs at the beginning of the TestSTand execution. Running MainSequence alone does not log the report to disk, which is why no error occurs.

WAS THIS ARTICLE HELPFUL?

Not Helpful