I'm working in C# on Visual Studio and my builds run on TFS.
This week I enabled code coverage via my tfs build (Let's assume that I have a .sln
Names MySln
and there is Tests.MySln
there too).
The code coverage via tfs stood on 6% and it's weird because when I ran it with Visual Studio Code Coverage in Test Section I got 70% (which is more correctly). After I downloaded the code coverage results from tfs I noticed that it somehow ran with more dlls that we're using via Nuget.
I tried some changes in .runSettings
file, but when I added include only MySln.dll, I got 0 code coverage and I don't want to create runSettings that say exclude all the other dll I saw that ran (I have 15 different slns and I don't want to create a list that might change between projects). I even tried to just enable code coverage without changes of runsettings.
Does someone knows which 'settings' does Visual Studio Test Code Coverage deliver? which config?.
Or have another idea how to create .runSettings
file?
Update
Op finally re-write the runSettings file fixed it.
This sounds like a configuration setting issue in Visual Studio or .runsettings file not related to TFS side.
Suggest you try to remote to the build agent and manually run the Code Coverage through the Visual Studio in remote agent directly. Check whether you get the same result if run it through TFS build server.