

NET 5+, open the project properties, select the Build tab, choose General, and inspect Debug symbols. pdb files are not updated when the project is built, then open the project properties, select the Build page, choose Advanced, and inspect Debug Info. Resolution-Make sure that your build settings generate the. pdb file must be generated from the same build as the. pdb file for a particular assembly, the assembly is not analyzed. exe file.Įxplanation-The code coverage engine requires that every assembly has its associated. Make sure that you have selected the most recent result set in the Code Coverage Results window.Īnalysis-Open the compile target folder (typically bin\debug), and verify that for each assembly, there's a. When you modify and rerun your tests, a previous code coverage result can still be visible, including the code coloring from that old run. Fix any failures before using Analyze Code Coverage. Resolution-In Test Explorer, choose Run All to verify that the tests run successfully. If none of the tests are executed, there's nothing for code coverage to report. It only includes assemblies that are loaded into memory when the tests run. See if there are any warnings or errors logged.Įxplanation-Code coverage analysis is done while tests are running. In the Show Output from drop-down list, choose Tests. No tests were executedĪnalysis-Check your output window. Possible reasons for seeing no results or old results Do you have the right edition of Visual Studio? You might have to expand the items to see the detail.įor more information, see Use code coverage to determine how much code is being tested. If you choose an Analyze Code Coverage command on the Test menu, and if the build and tests run successfully, then you should see a list of results in the Code Coverage window. This article helps you resolve those issues. " There are several reasons why you can get empty results.

However, in some cases, the Code Coverage Results window displays an error similar to "Empty results generated. The code coverage analysis tool in Visual Studio collects data for native and managed assemblies (. Applies to: Visual Studio Visual Studio for Mac Visual Studio Code
