gpt4 book ai didi

asp.net-core-2.0 - OpenCover 覆盖 ASP.Net core 2.0

转载 作者:行者123 更新时间:2023-12-04 17:48:41 25 4
gpt4 key购买 nike

我正在尝试使用 OpenCover 为在网站上执行的自动/手动测试生成覆盖率报告(如 this link 中所示)。我尝试了以下;

  1. 在独立模式下构建 .net core 2 web 应用程序并生成 exe。
    使用以下内容生成报告:

    C:\OpenCover\OpenCover.Console.exe -target:”C:\myproj\bin\Debug\myproj.exe” -output:C:\myproj\CoverageReports\myproj.results.xml -register:user

    这会生成包含空结果的报告。

  2. 在 IIS 10 中托管。但是,opencover 似乎还不支持 IIS 10。

是否可以使用 opencover 获得手动或自动测试代码覆盖率?

最佳答案

你应该为 net core 使用 -oldStyle:

C:\OpenCover\OpenCover.Console.exe -oldStyle -target:”C:\myproj\bin\Debug\myproj.exe” -output:C:\myproj\CoverageReports\myproj.results.xml -register:user

并设置<DebugType>full</DebugType>在你的项目中

关于asp.net-core-2.0 - OpenCover 覆盖 ASP.Net core 2.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46890386/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com