I'm trying to build a large mono-repo and obtain code coverage results in Azure DevOps. The code is a mixture of C#, VB and F#, mostly targeting .NET4.8 with a bit of netstandard2.0 thrown in.
Some time ago I got partial CI builds working with code coverage using a process where the solution was built using MS Build, then tested via dotnet test and coverlet.collector as outlined in this answer.
This solution worked happily until we decided to try and move from MS Hosted Agents to a self hosted Virtual Machine Scale Set. Using both a stock Azure Marketplace Visual Studio enterprise image and a custom image with Visual Studio build tools the pipeline has largely stopped producing results. Weirdly it does produce code coverage results for the 5 or so F# projects, but no results for the C#/ VB projects that make up the majority of the code base, and no error messages are produced.
The expected number of unit tests are reported to Azure DevOps so it appears that all the tests are running, but only the F# ones have code coverage, even though all the dlls are tested with the same command. The same commands run locally also produce coverage results, so I think it must be some component missing from the image that is installed on the MS hosted agents and my machine with VS Enterprise.
I have looked at the MS Build Tools docs and the repo for the MS Hosted agents but I'm struggling to figure out what is missing?