How to save test output logs in Visual Studio 2015

Teige, Connor 20 Reputation points
2023-08-30T18:12:55.5466667+00:00

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.
331 questions
{count} votes

Accepted answer
  1. Anna Xiu-MSFT 26,566 Reputation points Microsoft Vendor
    2023-08-31T03:44:33.6966667+00:00

    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 

    Sincerely,

    Anna


    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

0 additional answers

Sort by: Most helpful