I have a simple ASP.Net MVC 4 application with 3 simple tests.
Each of these tests run successfully to completion, however the Code Coverage window gives me the following 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. For more information see http://go.microsoft.com/fwlink/?LinkID=253731
I have done some research but nothing has resolved my problem to date.
If I find the .coverage file, all it has in it is:
PCHÿ
Not the xmls results or error message I am expecting.
Starting in Visual Studio 2022 Update 2, you can enable faster code coverage test results by selecting Tools > Options > Environment > Preview Features, then selecting Code coverage experience improvements, and then restarting Visual Studio.
To see code coverage for your test, click the three-bars icon that's next to your Org alias at the bottom of VS Code and open the class or trigger that you're testing. Click the the three-bars icon to toggle between enabling and disabling code coverage highlighting.
I realise this is over a year old. Nevertheless I have just encountered exactly the same issue, even down to the "PCHÿ" text in the .coverage file and have found no solution up 'til now. But surely someone else has had the issue too so, just in case, here's the simple solution:
After checking this MSDN link and following its advice I still had the same issue. So, in the end, I shutdown VS, went to the root solution directory and deleted the .suo file. It has the hidden attribute set so you might need to set explorer to show hidden files.
Restart VS and re-run the code coverage tests. All fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With