chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
(Updated 2011-06-23: added the complete typemockregister, -start and -stop sections)

Hi!
One of our teams are using typemock 6.0.3.0.
They are running their build on Teamcity 6.0.2 with a build agent on a windows 2008 server. The build agent runs with an account that is local admin on the machine.

Their nant build script autodeploys typemock like this:

<!-- Dynamically load TypeMock task. -->
<if test="${common.nunit.in.use-typemock}">
<loadtasks assembly="${common.nunit.in.typemock-dir}\TypeMock.NAntBuild.dll" />
<typemockregister company="Company" license="License-key" autodeploy="true"/>
<typemockstart/>
</if>

<exec program="${common.nunit.in.nunit-dir}" resultproperty="common.nunit.nunit-console-output" failonerror="false" >
<arg value="${common.nunit.in.project-path}" />
<arg value='/xml:"${common.nunit.in.project.buildlogs-dir}\${common.nunit.in.testlog-filename}"' />
<arg value="${common.nunit.in.optional-arguments}" if="${string::get-length(common.nunit.in.optional-arguments) > 0}" />
</exec>

<if test="${common.nunit.in.use-typemock}">
<typemockstop undeploy="true"/>
</if>


Their build log says:
[11:09:50]: [if] loadtasks
[11:09:50]: [loadtasks] Scanning assembly "TypeMock.NAntBuild" for extensions.
[11:09:50]: [if] typemockregister
[11:09:51]: [typemockregister] Typemock Isolator Auto Deployed, version 6.0.3.0
[11:09:51]: [typemockregister] Typemock Isolator Registered successfully
[11:09:51]: [common.nunit] exec (2m:05s)
[11:09:51]: [exec] NUnit version 2.5.7.10213
[11:09:51]: [exec] Copyright (C) 2002-2009 Charlie Poole.
[11:09:51]: [exec] Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
[11:09:51]: [exec] Copyright (C) 2000-2002 Philip Craig.
[11:09:51]: [exec] All Rights Reserved.
[11:09:51]: [exec] Runtime Environment -
[11:09:51]: [exec] OS Version: Microsoft Windows NT 6.0.6002 Service Pack 2
[11:09:51]: [exec] CLR Version: 2.0.50727.4211 ( Net 2.0 )
[11:09:51]: [exec] ProcessModel: Default DomainUsage: Single
[11:09:51]: [exec] Execution Runtime: Default
[11:09:56]: [exec] Excluded categories: Slow
[11:11:31]: [exec] ... (test related stuff)
[11:11:31]: [exec] Errors and Failures:
[11:11:31]: [exec] 1) Test Error : (testname)
[11:11:31]: [exec] TypeMock.TypeMockException :
[11:11:31]: [exec] *** Typemock Isolator needs to be linked with Coverage Tool to run, to enable do one of the following:
[11:11:31]: [exec] 1. link the Coverage tool through the Typemock Isolator Configuration
[11:11:31]: [exec] 2. run tests via TMockRunner.exe -link
[11:11:31]: [exec] 3. use TypeMockStart tasks for MSBuild or NAnt with Link
...
and then follows all the tests that fails because typemock doesn't work.

The eventlog at the teamcity 6.0 build agent windows 2008 server says:

Installation in the global assembly cache failed: D:\buildagent\work\f25cbe3c82c8d3b2\dev\lib\TypeMock Isolator 6.0\Configuration.dll
Installation in the global assembly cache failed: D:\buildagent\work\f25cbe3c82c8d3b2\dev\lib\TypeMock Isolator 6.0\TypeMock.Interceptors.dll
Installation in the global assembly cache failed: D:\buildagent\work\f25cbe3c82c8d3b2\dev\lib\TypeMock Isolator 6.0\TypeMock.dll
Removal of an assembly from the global assembly cache failed: D:\buildagent\work\f25cbe3c82c8d3b2\dev\lib\TypeMock Isolator 6.0\TypeMock.Interceptors.dll Typemock.Interceptors,Version=6.0.3.0
Removal of an assembly from the global assembly cache failed: D:\buildagent\work\f25cbe3c82c8d3b2\dev\lib\TypeMock Isolator 6.0\TypeMock.dll TypeMock,Version=6.0.3.0

Does anyone have any idea on what we have missed?

Regards, Daniel
asked by da9l (680 points)

4 Answers

0 votes
Hi Daniel,

Are you using any profiler other than Isolator (i.e. NCover, dotTrace)?
If so, check our online help at:
http://docs.typemock.com/isolator/Default.aspx##typemock.chm/Documentation/NAntBuild.html
and:
http://docs.typemock.com/isolator/Default.aspx##typemock.chm/Documentation/RunningCoverage.html
_________________
Regards

Yonatan,
TypeMock Support Group
answered by yonatan (1.6k points)
0 votes
Hi Yonatan!

I'm actually not involved in the project I'm just responsible for the build server, however, as far as I can see in the build file, (I've updated my original post to include the whole typemock block) it's only nunit that is used in the exec part.

My guess is that the cause for these problems is that typemock don't register properly since we get those Global Assembly Cache errors on the server (in the end of my original post) exactly at the same time as registration of typemock happens. I might be wrong on that but that is the best indication I have on what the problem might be.

Regards, Daniel Hegner
answered by da9l (680 points)
0 votes
Hi Daniel,

You may be right, but it seems as the DLLs were actually registered in the GAC, because afterwards, when the tests were run, an exception was thrown from those dlls...

Googling the error (warning) shows that is happens sometimes and it doesn't keep the app from running.

What is more important, is getting those tests to pass :-)
Please do check what i wrote in the previous post - because it looks like a profiler issue.
_________________
Regards

Yonatan,
TypeMock Support Group
answered by yonatan (1.6k points)
0 votes
Hi Yonatan!

I'll try to get that information from the project. From what I can see in their build script there is no other profiler involved but I don't have the complete picture...

However, there is one thing that I've failed to mention. This build runs fine on another server that is about to be decommissioned. The server where it works is a 32bit windows 2008 server with a teamcity 5.1 build agent while the server where I'm trying to get it to work is a 64bit windows 2008 server with a teamcity 6.0.2 agent.

Regards, Daniel
answered by da9l (680 points)
...