C# Visual Studio 2017是否有开放式封面工具或扩展?
我试图使用以下命令提取应用程序的覆盖率报告C# Visual Studio 2017是否有开放式封面工具或扩展?,c#,visual-studio,report,code-coverage,opencover,C#,Visual Studio,Report,Code Coverage,Opencover,我试图使用以下命令提取应用程序的覆盖率报告 OpenCover.Console.exe ^ -register:user ^ -target:"mstest.exe" ^ -targetargs:"/testcontainer:\"C:\myapp\bin\myapp.dll\" /resultsfile:\"myapp.trx\"" ^ -filter:"+[myapp*]* -[myapp.Test]* -[*]myapp.RouteConfig" ^ -mergebyhash ^ -ski
OpenCover.Console.exe ^
-register:user ^
-target:"mstest.exe" ^
-targetargs:"/testcontainer:\"C:\myapp\bin\myapp.dll\" /resultsfile:\"myapp.trx\"" ^
-filter:"+[myapp*]* -[myapp.Test]* -[*]myapp.RouteConfig" ^
-mergebyhash ^
-skipautoprops ^
-output:"myapp.xml"
然后报告
.\ReportGenerator.exe ^
-reports:"F:\OpenCover\myapp.xml" ^
-targetdir:"ReportGenerator"
但是我在运行open cover时遇到以下错误
我的命令有什么不对吗
PS:我已经注册了open cover profiler我使用的是mstest.exe,而不是在中运行测试用例 下面是使用open cover提取覆盖率报告的批处理文件代码片段
::Note:Before running this file, make sure opencover and reportgenerator installed in your system
::Download and read about opencover : https://github.com/OpenCover/opencover
::You can read about vstest.console command line documentation here https://msdn.microsoft.com/en-us/library/ms182486.aspx
::Set your project and report location's base path here
SET basePath=C:\MyProject
SET targetReportDir=F:\MyProject
SET targetHtmlReportDir=F:\MyProject\ReportGenerator
::Replace your test project Dll's path here
SET unitTestDlls=%basePath%\Demo.BusinessData\bin\Debug\Demo.BusinessData.Test.dll %basePath%\Demo.Cache.Test\bin\Debug\Demo.Cache.Test.dll
echo Test cases are running...
OpenCover.Console.exe -register:user -target:"vstest.console.exe" -targetargs:"%unitTestDlls%" -filter:"+[Demo*]* -[Demo*Test]* -[Demo*Test.Core]* -[Demo*Tests]*" -output:%targetReportDir%\DemoFullReport.xml -mergebyhash
echo Coverage report is preparing and will be saved to %targetHtmlReportDir%\Demo location
ReportGenerator.exe -reports:"%targetReportDir%\DemoFullReport.xml" -targetdir:"%targetHtmlReportDir%\Demo"
运行此批处理文件之前要检查的关键点