Yeah, I know - it's a constant issue. I tried all the hints and tips I could find, but couldn't get it to work. So here's my configuration:
Windows Server 2008 (X64)
TypeMock Isolator 5.1 (X64)
NCover 2.1 (X64)
NUnit 2.4.8
CC.NET 1.4
Here are the relevant parts from my MsBuild.targets file:
----------------------------------
<TypeMockRegister Company ="$(TypeMockCompany)" License="$(TypeMockLicense)" AutoDeploy="false"/>
<!--<exec command="regsvr32 -s "$(NCoverToolPath)NCover.Lib.x86.dll""/>-->
<TypeMockStart Link="NCover2.0" ProfilerLaunchedFirst="true"/>
<Exec Command=""$(NCoverToolPath)
cover.console.exe" //a "@(CoverageAssemblies->'%(Identity)',';')" //x "$(NCoverResultFile)" "$(NUnitToolPath)
unit-console.exe" $(NUnitCmdLineArgs)"
Condition="'$(CoverageAnalysisEnabled)'=='true'" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="NCoverExitCode"/>
</Exec>
<!--<NCover
ToolPath="$(NCoverToolPath)"
CommandLineExe="$(NUnitToolPath)
unit-console.exe"
CommandLineArgs="$(NUnitCmdLineArgs)"
AssemblyList="@(CoverageAssemblies)"
LogFile="c:
cover.log"
RegisterProfiler="false"
CoverageFile="$(NCoverResultFile)"/>-->
<TypeMockStop/>
<!--<exec command="regsvr32 -s -u "$(NCoverToolPath)NCover.Lib.x86.dll""/>-->
<Error Code="$(NCoverExitCode)" Text="Fehler bei Ausführen der Unittests." Condition="'$(NCoverExitCode)'>'0'"/>
--------------------------
As you can see I tried it using the NCover command as well as the exec command. I tried to register and unregister. I tried with and without the ProfilerLaunchedFirst attribute on TypeMockStart. I tried with and without the RegisterProfiler attribute on NCover. I even tried it manually by linking with the TypeMockConfiguration UI and running the commands with cmd.
The frustrating thing is: I can not get any deterministic behaviour! It wasn't working in the first placem, so I started to add and remove some attributes (with no result). I then managed to get it running manually - after that it also worked in CC.NET. I then started adding and removing some attributes again and couldn't get it to work any more. It does work running only NCover OR TypeMock, but it doesn't with both of them. I'm definitely running out of ideas - is there probably some more trick I need to to because of the X64?