I have several VB class libraries. For each library I had a test project with test files.
Everything worked just fine. NCrunch discovered and ran the tests, computed
Metrics. I saw the metrics in the NCrunch Metrics window.
For better or worse, I was asked to copy the class libraries and test files
into a new project (not what I wanted to do since now I have two sets of
code...)
However, in the new project the Metrics for all main code files shows as 0.00%.
Metrics for the test files in the Tests project range from 33.73% to 100%
(as expected).
A few things I did to reset the environment:
In the old project I set NCrunch to run tests manually.
In the new project I set NCrunch to run automatically.
In the new project I changed NCrunch to run tests manually.
Metrics for the main code still shows 0.00%.
I disabled and enabled NCrunch.
Metrics for the main code still shows 0.00%.
I restarted VS 2019.
Metrics for the main code still shows 0.00%.
Visual Studio 2019.
NCrunch 4.4.0.12
NUnit 3.12.0
ASP.NET Framework 4.7.2
Hi, thanks for sharing this issue. A few questions to try and figure out what is going on:
- On the projects missing metrics, do you still have coverage markers?
- If so, are the coverage markers aligned with the metrics being aggregated?
- Does the metrics window still show the correct number of lines and other metrics?
re: - On the projects missing metrics, do you still have coverage markers?
All code lines have black coverage markers.
re: - If so, are the coverage markers aligned with the metrics being aggregated?
I don't understand your question.
re: - Does the metrics window still show the correct number of lines and other metrics?
I wanted to add a screenshot of the Metrics window but couldn't figure out
how to do that.
So here's some stats for one of the code files:
Code Coverage %: 0.00%
Compiled Lines: 45
Covered Lines: 0
Code Lines: 45
Excluded Line: 0
Uncovered Lines: 45
I wondered if I had put in a: ' NCrunch: start no code coverage.
but didn't close it with a: 'NCrunch end no code coverage.
I don't have any start\end code coverage statements
in my class library.
Thanks for the extra details. It looks like this is a missing code coverage issue. Can you check if any of the suggestions on this documentation page work for you?