My solution is set up with projects called \"ProjectName\" with \"ProjectName\".Tests containing my unit tests. I\'d like to exclude the test projects from the code coverage
There is a connection with the period issue as it was mentioned here. If you change the exclude section to this
<ModulePath>.*tests.dll</ModulePath>
<ModulePath>.*Tests.dll</ModulePath>
or this
<ModulePath>.*\.tests\..*</ModulePath>
<ModulePath>.*\.Tests\..*</ModulePath>
it'll work
You can exclude it by excluding the project dll or by using project name itself also. E.g. -
<ModulePaths>
<Exclude>
<ModulePath>Fabrikam.Math.UnitTest.dll</ModulePath>
<!-- You can add more ModulePath nodes here. -->
</Exclude>
</ModulePaths>
This MSDN link is useful for it.