How to save test output logs in Visual Studio 2015

Teige, Connor 0 Reputation points

Can't seem to find a way to save the output of unit tests to a .trx file. Seems like during the change from VS2010 to VS2015 we've lost that feauture. Problem is our tests can sometimes cause VS2015 to crash, especially when we're running overnight, and sadly the test results aren't saved anywhere so we're not able to know which test caused visual studio to crash.

We use a .runsettings file that references a .testrunconfig for configuration.

Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
299 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 18,796 Reputation points Microsoft Vendor

    Hi @Teige, Connor, 

    Welcome to Microsoft Q&A! 

    You can try to use the vstest.console.exe to logs the test results to a .trx file.

    By default, the vstest.console.exe file is located in the C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow folder.  

    Please open the developer command prompt Visual Studio 2015 and run the following command:

    vstest.console.exe "YourTestProjectPath\YourTestProject\bin\<DebugorRelease>\TestProject.dll" /Logger:trx 

    Then, you can find the test results in the location:

    C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\TestResults 



    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    0 comments No comments