Team System Developer Center > Visual Studio Team System Forums > Visual Studio Team System - Testing > Unable to get code coverage using VSPerfCmd and VSInstr for a web application hosted on IIS
Ask a questionAsk a question
 

QuestionUnable to get code coverage using VSPerfCmd and VSInstr for a web application hosted on IIS

  • Wednesday, June 17, 2009 3:05 AMterrence_cyril Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

      I have a web application with two binaries that is hosted as a virtual directory on IIS 7.0 on Windows Vista.  I tried the following steps as instructed in VS team system blogs but to no avail.

    STEPS for code coverage:
    • vsperfclrenv /globaltraceon
    • reboot
    • vsinstr /COVERAGE [assembly]
    • vsperfcmd /START:COVERAGE /OUTPUT:[ouputfile].coverage /CS /USER:"[ASP.NET worker process user]"
    • vsperfcmd /ATTACH:[w3wp process id]
    • Run the test scenario against the web application
    • vsperfcmd /DETACH
    • iisreset /STOP
    • vsperfcmd -SHUTDOWN
    I get an empty code coverage file. When I open the .coverage file in VS 2008, I find no coverage data. I get the message 'Empty Results generated: none of the instrumented binaries were used...'

    But, when I host the web application on the VS dev server and run the tests, I can get the code coverage results.

    Also after I launch VSPerfCmd, I checked the status using vsperfcmd /status.   I found that it was not profiling\monitoring w3wp.exe process for code coverage. I get the following report

    Microsoft (R) VSPerf Command Version 9.0.21022 x86
    Copyright (C) Microsoft Corp. All rights reserved.


    Process and Thread Status
    ============================================================
    Output File Name            : C:\ResultsFolder\CCresults.Coverage
    Collection mode             : COVERAGE
    Maximum Processes           : 64
    Maximum Threads             : 256
    Number of Buffers           : 258
    Size of Buffers             : 65536
    ============================================================
    Maximum Number of Processes : 64
    Number of Active Processes  : 0
    Global Start/Stop Count     : 1
    Global Suspend/Resume Count : 0
    ============================================================
    Users with access rights to monitor:
    UserName (SID)
    NT AUTHORITY\SYSTEM (S-1-5-18)
    BUILTIN\Administrators (S-1-5-32-544)



    Can someone please tell me if I am doing something wrong or am I missing a setting ?

All Replies