locked
How to enable code coverage in Team Build using VS2010 and TFS 2008

    Question

  • Hi,

          I have been trying to enable code coverage using VS2010 and TFS2008. In VS2010, I know MS has updated .runconfig to .testsettings. In VS2008, to use the .testrunconfig file in Team build, we just need to use <RunConfigFile>FileName.TestRunConfig</RunConfigFile>. What is the command to use in teambuild to run .testsettings VS2010 ?

     

    Thanks


    JY
    Tuesday, July 27, 2010 2:14 AM

Answers

  • Hi,

    If you have configure TFSbuild2008 to use MSBuild 4.0 (MSTest 10), code coverage of TFSBuild 2008 could not work. You have to run VS to get the CodeCoverage Result manually.


    Best regards,
    Ruiz
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com
    • Marked as answer by JY_JFOXY Thursday, August 05, 2010 3:36 PM
    Tuesday, August 03, 2010 9:58 AM
    Moderator

All replies

  • Hi JY,

    As far as I know, TFSBuild2008 code coverage does not support .NET4.0 assembly. The service is target .NET3.5.


    Best regards,
    Ruiz
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com
    Wednesday, July 28, 2010 10:09 AM
    Moderator
  • Hi Ruiz,

     

        Thanks for the reply.

        Does that mean I still need to keep using .testrunconfigfile to do my code coverage on 2008 teambuild?

        The problem is when I try to create config file for unittest on my VS2010 project, There is no way to create .testrunconfigfile. We only have .testsettings as the configfile and the bigger problem is code coverage can only be done thru config file.

         If this is the case, the only way to do code coverage in VS2010 by teambuild is to upgrade to TFS2010?

     

        Thanks

     


    JY
    Wednesday, July 28, 2010 6:50 PM
  • Hi JY,

    Sorry for the inconvenience.

    Yes, you have to upgrade to TFS2010 with TeamBuild2010. TFSBuild 2008  Code Coverage Analysis Service could not load .Net 4.0 assembly. You have to use VS2010 to get code coverage locally.


    Best regards,
    Ruiz
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com
    Friday, July 30, 2010 7:25 AM
    Moderator
  • Hi Ruiz,

     

       We are not using any .net 4.0 assembly actually. It's a vs2008 unit test project that we migrated to vs2010 project. All the unit test in the project after they are in VS2010 still use 3.5 SP1 framework.

       "TFSBuild 2008  Code Coverage Analysis Service could not load .Net 4.0 assembly. You have to use VS2010 to get code coverage locally.", Are you referring to MSTest.exe by that? because I did install VS2010 in our build server to get all Unit Test run fine.

     

        Thanks

     

     


    JY
    Friday, July 30, 2010 8:55 PM
  • Hi,

    If you have configure TFSbuild2008 to use MSBuild 4.0 (MSTest 10), code coverage of TFSBuild 2008 could not work. You have to run VS to get the CodeCoverage Result manually.


    Best regards,
    Ruiz
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com
    • Marked as answer by JY_JFOXY Thursday, August 05, 2010 3:36 PM
    Tuesday, August 03, 2010 9:58 AM
    Moderator