Refactoring and Code Coverage

When re-factoring the code it is sometimes necessary to remove a project. This has happened a couple of times in my current project. For a while ago, I had to remove an assembly from the application when I re-factored the code. All my unit tests worked both locally and on the build server, but the build report said that the build just partially succeeded. The build log included an error message that told that it couldn’t find and copy the old assembly during the build process. This was a bit strange, since I was pretty sure that I managed to remove all dependencies and Visual Studio shouldn’t be looking for it. After some discussion with my colleagues, googling and testing I found out that the problem was that the assembly still was registered for code coverage. That’s why Visual Studio still was looking for it, and by removing it from code coverage the build succeeded completely again.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.