NuGet: https://www.nuget.org/packages/OpenCover/
安装: Install-Package OpenCover -Version 4.6.519
csproj文件添加: <DebugType>Full</DebugType>
cd C:\Users\用户名\.nuget\packages\opencover\4.6.519\tools
OpenCover.Console.exe -target:"C:\Program Files\dotnet\dotnet.exe" -targetargs:"test xUnit项目csproj路径" -register:user -filter:"+[*]* -[xunit*]*" -oldStyle -output:"Xml报告文件路径"
OpenCover.Console.exe -target:"C:\Program Files\dotnet\dotnet.exe" -targetargs:"test D:\git\qi\test\Qi.xUnit\Qi.xUnit.csproj" -register:user -filter:"+[*]* -[xunit*]*" -oldStyle -output:"d:\report.xml"
NuGet: https://www.nuget.org/packages/ReportGenerator/
安装: Install-Package ReportGenerator -Version 4.0.4
语法:https://danielpalme.github.io/ReportGenerator/usage.html
dotnet C:\Users\用户名\.nuget\packages\reportgenerator\4.0.4\tools\netcoreapp2.0\ReportGenerator.dll "-reports:OpenCover产生的Xml报告文件路径" "-targetdir:Html报告生成目录"
dotnet C:\Users\tongqijie\.nuget\packages\reportgenerator\4.0.4\tools\netcoreapp2.0\ReportGenerator.dll "-reports:d:\report.xml" "-targetdir:d:\output"