Coverage info for some assemblies is missing
Symptoms
Some of the projects/assemblies that should be covered are shown with 0% coverage in the Unit Test Coverage window.
Cause
- PDB files are absent / can not be found / does not match
- The project is filtered from coverage analysis
Solution
First steps
- Drop coverage data with a trash bin icon in Unit Test Coverage toolbar.
- Clear caches:
- ReSharper: Clear caches and restart the Visual Studio | Click
- Rider: File | Invalidate Caches | Invalidate and Restart.
Troubleshooting coverage filtering
- Check that assemblies are not excluded by coverage filters at dotCover | Filtering.
- Delete "Everything" filter from "Do not analyze code in" section.
- If there are some "Analyze code only in" filters, check that the required project is among the included projects.
- To exclude filtering issue try adding include filter consisting of wildcard, which will be shown as "Everything"
- If the "Include Everything" filter helped, but the root cause is unclear, please submit a support request with the dotCover logs
PDB files troubleshooting
- Check that the build configuration is "Debug" (this configuration by default produces PDB files as artefacts)
- Check if the build artefact are obfuscated. Disable obfuscation in order to collect coverage.
- Debug symbols type is set to "PDB files, portable across platforms". In
*.csproj
file, the property looks like this:<DebugType>portable</DebugType>
- Verify that PDB files are indeed located in the Build Output directory. If it is expected that PDB files reside elsewhere, see documentation for more info.
- Check that the assembly is not located in Global Assembly Cache (GAC). If so, it will be loaded from there by default.
Nothing helped
If the issue remains, please submit a support request with the dotCover CORE logs with the following logs masks:
Core logs: Snapshot;Bridge;PdbBridge;MetaDataGt;PdbGt;MethodFilterGt;InstrumentationGt
Pdb server logs: CoreBridge;PdbGt
Please sign in to leave a comment.
I see issues with dotCover when you mix different framework targets in one solution. I had assemblies for .net core 3.1 and 3.0. dotCover doesn't show any test coverage for 3.0 assembly. After change to the same target for all assemblies it works again.
File | Settings | dotCover | Highlighting and check the 'Enable Highlighting' checkbox.
I have had to enable this after updates it gets unchecked sometimes.
Had the same issue, solved it by invalidating the cache.
File -> Invalidate caches...