I want exclude all migration classes from the code coverage analyze result. So I used the following code in codecoverage.runsettings
file but code coverage analyze result is include migration namespace classes yet.
The namespace of migration classes is MySolution.Data.Migrations
and they are in the Migrations
directory of the MySolution.Data
project.
Data Project > codecoverage.runsettings
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Configuration>
<CodeCoverage>
<!-- configuration elements -->
<Functions>
<Exclude>
<Function>.*\.Data.Migrations\..**</Function>
</Exclude>
</Functions>
</CodeCoverage>
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>