英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论