Can't analyze code coverage with Visual Studio 2019

余生长醉 提交于 2020-04-11 12:27:45

问题


I'm using Visual Studio 2019 to develop and test a .NET Core application. A few months ago, I remember that all my tests are successful and I was able to launch a code coverage analyze. Today I launched a code coverage analyze but it fails (tests are always successful):

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. For more information see https://go.microsoft.com/fwlink/?LinkID=253731

I have always upgraded my Visual Studio and the current version I have now is Microsoft Visual Studio Enterprise 2019 (Version 16.4.0)

Any experience or feedback about this problem?


回答1:


Strange enough setting the "Processor Architecture" to x64 worked for me:

See screenshot




回答2:


In my case, with a fresh installed VS 2019 Enterprise and a simple solution with two projects:

  • static library
  • native unit test project (testing the library above)

I got the same error "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 solution was to enable "Profile" on the linker section of the native unit test project.



来源:https://stackoverflow.com/questions/59250411/cant-analyze-code-coverage-with-visual-studio-2019

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!