I think you are gettig this error because, you did not configure TypeMock to run the test using MSTest. This you can do if did not do yet in your TeamCity Build Agent machine by following the below steps:
- Windows "Start" >> All Programs >> TypeMock Folder >> Isolator Folder >> Open Isolator Configuration
- In the new windows opened under
Profilers/Code Coverage
tab, check the check box Show only available profilers
and in the drop down above that it should list NCover (This is with the assumption that you are using NCover for profiling unit test cases coverage and all).
- Select NCover from drop down and click on
Link with TypeMock Isolator
.
By this TypeMock Isolator will be configured to profile unit test as well and by that I think your TypeMock disabled issue will be resolved I hope.
EDIT:
Sorry for the wrong point. The above will help you if you are using profilers like NCover in your build.
You should use the below MSBuild to run test using MSTest and TypeMock:
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="RunTests" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="NCover.MSBuildTasks.NCover" AssemblyFile="C:\Program Files\NCover\Build Task Plugins\NCover.MSBuildTasks.dll" />
<Import Project ="C:\Program Files (x86)\Typemock\Isolator\6.1\TypeMock.MSBuild.Tasks" />
<PropertyGroup>
<MSTest>"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe"</MSTest>
</PropertyGroup>
<Target Name ="RunTests">
<TypeMockStart Target="3.5" />
<Exec ContinueOnError="true" Command='$(MSTest) /noisolation "/testcontainer:C:\continuousintegration\root\CTM_VPOFFICEClassLibraries\CTM.VPOffice\CTM.VPOffice Unit Testing\bin\Release\CTM.VPOffice Unit Testing.dll"' />
<TypeMockStop />
</Target>
</Project>
You can ignore the NCover related things in the above sample and the just ignore the Isolator Configuration steps if you don't have Test profiling in your build process.