惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

TaoSecurity Blog
TaoSecurity Blog
Jina AI
Jina AI
雷峰网
雷峰网
月光博客
月光博客
The GitHub Blog
The GitHub Blog
WordPress大学
WordPress大学
B
Blog RSS Feed
美团技术团队
C
CXSECURITY Database RSS Feed - CXSecurity.com
小众软件
小众软件
Security Latest
Security Latest
Microsoft Azure Blog
Microsoft Azure Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cybersecurity and Infrastructure Security Agency CISA
Last Week in AI
Last Week in AI
A
Arctic Wolf
Latest news
Latest news
Attack and Defense Labs
Attack and Defense Labs
I
Intezer
F
Fortinet All Blogs
罗磊的独立博客
MongoDB | Blog
MongoDB | Blog
Webroot Blog
Webroot Blog
S
Secure Thoughts
Help Net Security
Help Net Security
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
V
Visual Studio Blog
P
Proofpoint News Feed
博客园 - 【当耐特】
P
Privacy International News Feed
V
Vulnerabilities – Threatpost
Stack Overflow Blog
Stack Overflow Blog
Know Your Adversary
Know Your Adversary
云风的 BLOG
云风的 BLOG
Hacker News: Ask HN
Hacker News: Ask HN
L
LINUX DO - 最新话题
H
Help Net Security
爱范儿
爱范儿
酷 壳 – CoolShell
酷 壳 – CoolShell
S
SegmentFault 最新的问题
Forbes - Security
Forbes - Security
T
Tailwind CSS Blog
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tenable Blog
Cloudbric
Cloudbric
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Hugging Face - Blog
Hugging Face - Blog

博客园 - Coding让生活更美好

Entity Framework search sequnce Runtime Complexity of .NET Generic Collection update the UI property cross thread 打通技术的任督二脉 windbg symbol path 一个文件夹可以link 到另外一个文件夹 Series on Coded UI Test Extensibility Launching the Debugger Automatically 修复软件安装问题和软件卸载问题 EF6 大数据框架整理 技术要点整理 修改table 设置默认值 PowerShell - Special Characters And Tokens To open the project created by previous version of Visual Studio 获取Powershell write-host 的内容 Powershell 转义字符 asp.net Login控件基本属性及事件说明 if test project can't be opened in devenv
How to do code coverage test for windows service
Coding让生活更美好 · 2014-07-09 · via 博客园 - Coding让生活更美好

First, instrument the exe or dll by command

vsinstr -coverage the dll/exe

second, start the performance monitor

VSPerfCmd.exe /start:coverage /output:"D:\Latest.Coverage" /cs /user:"Everyone"

at this time, we could check the status by running command:

VSPerfCmd.exe /status

third, start the windows service  and execute the test scenario.

Fourth, shut down the performance monitor tool by

VSPerfCmd.exe /shutdown

Trouble shooting:

on the 64 bit machines, you may could not get the coverage, instead it shows message:

  Empty results generated: No binaries were instrumented. Make sure the tests ran, required binaries were loaded, had matching symbol files, and were not excluded through custom settings. For more information see http://go.microsoft.com/fwlink/?LinkID=253731    

and in the event view, has error with source: VSPERF 

Unable to connect to monitor.  Make sure the monitor is started and in the correct mode.

Resolving by:

Run the above command from the tools for x64 machines, it located at

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Performance Tools\x64