Search code examples
c#analyzer

Is it possible to run vs 2019 code analyze by command and not by gui?


I'm using vs 2019 enterprise Is it possible to run vs 2019 code analyze by command and not by gui? if yes what command is it? thanks.


Solution

  • After investigation the answer is YES and this is the command:

     vstest.console.exe ut.dll /Enablecodecoverage 
    

    VSTest.Console.exe is the command-line tool to run tests

    ut.dll is the unit test project I want to run

    /Enablecodecoverage is the option to run code coverage via cmd.

    for more explanation on vstest.console.exe see here