???????????????漰??C#???????????????????????????????C#???????????????Щ???????????????Щ?????????????????????????????????????????????л????????????·????????????????????е?????????????????д?????????????????????????ù????????????ɡ?

??????????????VS?????vsinstr????

????????????????VS2010????VS2012??

????????????????裬???????????

????1. ??????DLL???в????

????"C:Program Files (x86)Microsoft Visual Studio 10.0Team ToolsPerformance Toolsx64vsinstr" -coverage "D:xxx.dll"


?????????dll?????????? *.orig??????????????????????????????DLL????????????

????2. ???coverage????????????

????start vsperfmon -coverage -output:"D:xyz.coverage" /CS /user:everyone

????3. ???б?????????????????С?

????4. ??????е???????????????á?

????5. ??coverage???????????????

????vsperfcmd /shutdown

 

????6. ???D:xyz.coverage??????????????VS?????? ???????block????????????source code?????????????

?????????С??

????1. ???????????????棬????????VS??????????????????α???????????????????????????????

????2. ????????????DLL?????????exe?????г????

????3. ??????????????????????????????VS???????

????4. ?????????????block?????????????????????line??????

???????????????????OpenCover????

?????????????

????1. ???OpenCover????????????????msi????zip??

????2. ????ReportGenerator??????????OpenCover?????XML????????????????HTML???檔

???????????裺

????1. ??VS?????????C#д???С?δ???????????????????????????δ??????????????? ConsoleApplicaiton1.exe

????2. ???OpenCover???????ConsoleApplicaiton1.exe??????????????????????????????

????-output:c2.xml ????????????????????

????-targetdir: ????OpenCover???exe?????PDB??????????????PDB????????????

????-register ????????????????????????????????????????????????????????

?????????????????OpenCover?????

?????????????

????OpenCover.Console.exe -register -target:"C:Users ickyqiuDocumentsVisual Studio 2012ProjectsConsoleApplication1ConsoleApplication1inDebugConsoleApplication1.exe" -output:c2.xml -targetdir:"C:Users ickyqiuDocumentsVisual Studio 2012ProjectsConsoleApplication1ConsoleApplication1inDebug"

??????е??????????cmd?????????????????????????????????????????????