Visual Studio Code Coverage: 生成的结果为空:未对任何二进制文件进行仪器化。

huangapple go评论77阅读模式
英文:

Visual Studio Code Coverage: Empty results generated: no binaries were instrumented

问题

I am using Visual Studio Enterprise 2022 version 17.6.5. For certain repositories, I cannot utilize Code Coverage. I have tried the following:

  • Every option for Processor Architecture for AnyCPU Projects (x86, x64, ARM64, Auto)
  • Deleting .suo files
  • Reinstalled Visual Studio
  • Repaired Visual Studio
  • Disabling both debug and release optimization
  • Toggling the preview feature Code Coverage native static instrumentation

The complete error is:
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.

The tests did run. I can't find what the required binaries are though. The code coverage was not excluded through custom settings, as a colleague can run code coverage on all the repositories.

I am using the following NuGet packages in my test project:

  • Microsoft.NET.Test.Sdk 17.6.3
  • Moq 4.18.4
  • FluentAssertions 6.11.0
  • xunit 2.5.0
  • xunit.runner.visualstudio 2.5.0

They are all the latest versions.

I have only installed the .NET desktop development package from the Visual Studio Installer.
The problematic repos are all .NET 6, upgraded from .NET Core 3.1, as are the repos that are fine, so I don't think that's the issue. What are other steps I can take to try to solve this issue?

英文:

I am using Visual Studio Enterprise 2022 version 17.6.5. For certain repositories, I cannot utilize Code Coverage. I have tried the following:

  • Every option for Processor Architecture for AnyCPU Projects (x86, x64, ARM64, Auto)
  • Deleting .suo files
  • Reinstalled Visual Studio
  • Repaired Visual Studio
  • Disabling both debug and release optimization
  • Toggling the preview feature Code Coverage native static instrumentation

The complete error is:
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.

The tests did run. I can't find what the required binaries are though. The code coverage was not excluded through custom settings, as a colleague can run code coverage on all the repositories.

I am using the following NuGet packages in my test project:

  • Microsoft.NET.Test.Sdk 17.6.3
  • Moq 4.18.4
  • FluentAssertions 6.11.0
  • xunit 2.5.0
  • xunit.runner.visualstudio 2.5.0

They are all the latest versions.

I have only installed the .NET desktop development package from the Visual Studio Installer.
The problematic repos are all .NET 6, upgraded from .NET Core 3.1, as are the repos that are fine, so I don't think that's the issue. What are other steps I can take to try to solve this issue?

答案1

得分: 0

我的同事成功运行代码覆盖率是从版本17.0.21开始的。当我从17.6.5降级到17.2.17时,我的代码覆盖工具再次运行。

英文:

My colleague who was successful in running code coverage did this from version 17.0.21. When I downgraded from 17.6.5 to 17.2.17, my code coverage tool ran again.

huangapple
  • 本文由 发表于 2023年7月18日 16:21:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/76710802.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定