Not SmartRunner - just running mocked tests (locally or on a build server) using a .runsettings file instead of a .testsettings file (which is now considered obsolete by VS2012).
If I run unit tests under the following .runsettings file, I get this message in the Test Results window and no tests are executed.
------ Run test started ------
Exception has been thrown by the target of an invocation.
========== Run test finished: 0 run (0:00:03.9063906) ==========
This .runsettings causes the above error:
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<!-- Configurations that affect the Test Framework -->
<RunConfiguration>
<!-- Path relative to solution directory -->
<ResultsDirectory>.TestResults</ResultsDirectory>
<!-- [x86] | x64
- You can also change it from menu Test, Test Settings, Default Processor Architecture -->
<TargetPlatform>x86</TargetPlatform>
<!-- Framework35 | [Framework40] | Framework45 -->
<TargetFrameworkVersion>Framework45</TargetFrameworkVersion>
</RunConfiguration>
<!-- Configurations for data collectors -->
<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>
<ModulePaths>
<Include>
<ModulePath>foo.*</ModulePath>
</Include>
<Exclude>
<ModulePath>.**test*.dll</ModulePath>
</Exclude>
</ModulePaths>
</CodeCoverage>
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
<!-- Adapter Specific sections -->
<!-- MSTest adapter -->
<MSTest>
<!--<IgnoreTestImpact>true</IgnoreTestImpact>-->
<MapInconclusiveToFailed>True</MapInconclusiveToFailed>
<CaptureTraceOutput>false</CaptureTraceOutput>
<DeleteDeploymentDirectoryAfterTestRunIsComplete>False</DeleteDeploymentDirectoryAfterTestRunIsComplete>
<DeploymentEnabled>False</DeploymentEnabled> <!-- TODO: come back after this file is figured out and then try running unit tests directly in the build output directory -->
</MSTest>
</RunSettings>
However, if I comment out the code coverage section (see .runsettings below), everything works. I was assuming this is because of some of the problems TypeMock has with VS2012 (note that I am still using v7.0.9) and was hoping this error has been/will be fixed in the latest release.
This .runsettings file works - note that I have commented-out the 'CodeCoverage' section:
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<!-- Configurations that affect the Test Framework -->
<RunConfiguration>
<!-- Path relative to solution directory -->
<ResultsDirectory>.TestResults</ResultsDirectory>
<!-- [x86] | x64
- You can also change it from menu Test, Test Settings, Default Processor Architecture -->
<TargetPlatform>x86</TargetPlatform>
<!-- Framework35 | [Framework40] | Framework45 -->
<TargetFrameworkVersion>Framework45</TargetFrameworkVersion>
</RunConfiguration>
<!-- Configurations for data collectors -->
<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>
<ModulePaths>
<Include>
<ModulePath>foo.*</ModulePath>
</Include>
<Exclude>
<ModulePath>.**test*.dll</ModulePath>
</Exclude>
</ModulePaths>
</CodeCoverage>-->
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
<!-- Adapter Specific sections -->
<!-- MSTest adapter -->
<MSTest>
<!--<IgnoreTestImpact>true</IgnoreTestImpact>-->
<MapInconclusiveToFailed>True</MapInconclusiveToFailed>
<CaptureTraceOutput>false</CaptureTraceOutput>
<DeleteDeploymentDirectoryAfterTestRunIsComplete>False</DeleteDeploymentDirectoryAfterTestRunIsComplete>
<DeploymentEnabled>False</Deplo