none
Setting up a VS 2017 remote build server (missing codecoverage.exe)

    Question

  • I am setting up a new remote build server that is managed by the Jenkins CI application.  (Powershell scripts are used to do the builds and tests)  Our developers are starting to work with Visual Studio 2017, so we need a system that can build solutions and test them using VStest.console.exe with code coverage.  (our VS2015 solution that works, by the way)

    My current stumbling block is this error during the vstest phase.

    Warning: Diagnostic data adapter ('Code Coverage') message: Cannot find CodeCoverage.exe..

    With the new install process, that 2017 provides, I am trying to install just what I need to do the builds and to test through the "individual components" install menu.  So far, I have chosen:

    Under Compilers, Build Tools, and Runtimes I have selected "C# and Visual Basic Roslyn compilers" and "MSBuild".

    Under Debugging and Testing I have selected "IntelliTrace" and "Testing tools core features" for VSTest and MSTest ability.

    I had also found that I needed to download and install the "Agents for Visual Studio 2017" to get the codecoverage.exe.

    I added the codecoverage.exe path to the system path variable and it allows me to run codecoverage.exe from any prompt.  It just seems that I am missing a connection between VSTest.console.exe and codecoverage.exe.

    Friday, April 14, 2017 9:00 PM

Answers

All replies

  • Hi S,

    Thank you for posting in MSDN forum.

    This forum is discussing about Visual Studio Setup and installation, As your question is much related to Test, I help you move to test forum for much professional support.

    Thank you for your understanding and cooperation.

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, April 17, 2017 6:58 AM
  • Hi friend, 

    I wonder how you run the test. 

    Two ways here:

    Run it directly (select option Analyze code coverage )through visual studio IDE;

    Or

    Run it in command line: vstest.console.exe Test.dll /EnableCodeCoverage

     

    Feel free to let me know if I misunderstood.

    Best regards,

    Fletch


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Tuesday, April 18, 2017 6:03 AM
  • Fletch,

    I am running the test via the second option:   

    vstest.console.exe Test.dll /EnableCodeCoverage

    That is when I get the error.  

    Friday, April 21, 2017 1:16 PM
  • Hi Heath S. _,

    Which VS2017 version did you real use?

    Could you get the CodeCoverage.exe from the path C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Team Tools\Dynamic Code Coverage Tools?

    I check it in different VS versions, I just get this exe file in the VS2017 Enterprise version, it has no this tool in the VS2017 Professional version. 

    I didn't install the test agent in my side, so if your machine has no this tool in your build agent machine(test running machine), please check your current VS2017 version and make sure that it really has this tool.

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Sunday, April 23, 2017 6:43 AM
    Moderator
  • Jack,

    The VS2017 version is Enterprise.  In IDE installs, the tool is there and it works as advertised.  It is just on this build server, I was hoping to not have to install the IDE, but only the components I need to do a build and test of the code.

    I have the agent tools installed and I can run codecoverage.exe from the command line.  It just doesn't work when running vstest.exe with the /enablecodecoverage switch.

    Tuesday, May 02, 2017 5:28 PM
  • I would also like to ask...

    What is missing that running VSTEST.CONSOLE.EXE with the /EnableCodeCoverage switch has it that VSTEST cannot find CodeCoverage.exe even though I can run codecoverage.exe directly from the working directory (as it is in the path).  

    Is it a setting specific for vstest.console.exe that I need to adjust to tell it where codecoverage.exe exists?

    Do I need an extra step to register a library or assembly, that would happen with an IDE install, that doesn't happen during a component only install of VS2017Enterprise?

    Tuesday, May 02, 2017 6:42 PM
  • Hi friend,

    I could repro this by deleting the codecoverage.exe under the folder :

    C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Team Tools\Dynamic Code Coverage Tools

    in my end,

    the error looks like:

    So please make sure that codecoverage.exe exists in the folder as I poste above.

    Best regards,

    Fletch


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Thursday, May 04, 2017 9:00 AM
  • Fletch,

    Yes, Codecoverage.exe exists in that folder.

    It is like vstest cannot find codecoverage.  I am able to run the codecoverage.exe from any folder, as it is in the path.  That is what makes me think that vstest is looking in a specific location for codecoverage, as it should work.  Where could that be configured?

    Heath

    Thursday, May 04, 2017 9:05 PM
  • Hi friend,

    Could you add the codecoverage.exe path to system variables and have a try?

    Best regards

    Fletch


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    Tuesday, May 09, 2017 1:09 PM
  • Thanks for the reply, Fletch.

    I do have 3 variables in System.  1 for each of the VS installs I have on this system.

    VS110COMNTOOLS

    VS120COMNTOOLS

    VS140COMNTOOLS

    Is there anything I should be looking for that is specific to VS 2017?

    Tuesday, May 09, 2017 6:17 PM
  • The solution was actually found here:

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/6b32aac0-c3e2-4495-b5ef-e42227554ddb/minimum-individual-components-for-a-vs2017-build-server?forum=vssetup

    Since you want a build server, you don't need Visual Studio, which is a development tool. You can download and install the following components from https://www.visualstudio.com/downloads/:

    - Other Tools and Frameworks > Build Tools for Visual Studio 2017: These Build Tools allow you to build native and managed MSBuild-based applications without requiring the Visual Studio IDE. There are options to install the Visual C++ compilers and libraries, MFC, ATL, and C++/CLI support.

    - Tools for Visual Studio 2017 > Agents for Visual Studio 2017: Agents for Visual Studio 2017 can be used for load, functional, and automated testing. For more details, please refer to the ALM blog.


    My portal and blog about VSX: http://www.visualstudioextensibility.com; Twitter: https://twitter.com/VSExtensibility; MZ-Tools productivity extension for Visual Studio:https://www.mztools.com

    • Marked as answer by Heath S. _ Tuesday, May 23, 2017 5:47 PM
    Tuesday, May 23, 2017 5:47 PM