Our build server is TFS2015 and Microsoft promises that we can customize code coverage analysis. But with runsettings setup to exclude assemblies from code coverage exceptions fail the build. Not nice.
Today we figured out how to work around this and exclude an assembly from code coverage. The key was in the msdn article; the pdb file was needed to get code coverage. Would this mean that when the pdb file was not there no code coverage was registered?
The assembly we wanted to exclude was Common.Logging. The nuget includes the pdb file for debugging purposes. We’re about to delete it in our build sequence:
The delete files step removes the Common.Logging.pdb before the Visual Studio Test step. Now the code coverage is not calculated for Common.Logging. Mission accomplished.