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
0 votes
We are currently having issues with getting TypeMock 4.3.1 to run on our build server. We are using FinalBuilder
5.5.707 and CCNet 1.4.3400 to run our builds. TypeMock is auto deployed. The build server is running Windows 2008 x64, but the TypeMock assemblies are the x86 version as we cannot get FinalBuilder to call the x64 version of MSBuild and so TypeMock x64 fails on auto deploy.

With 4.2.4 everything worked just fine, but as soon as we swapped the TypeMock files we include with the project files to 4.3.1 the auto deploy still works just fine, but the test no longer run. The error message we get is:

[Execute Program [ C:\FinalBuilder\AquaFuture\Mainline\WorkingFolder\SW\3rdParty\TypeMock\bin\TMockRunner.exe ]]
Executing : C:\FinalBuilder\AquaFuture\Mainline\WorkingFolder\SW\3rdParty\TypeMock\bin\TMockRunner.exe
With Command Line : -target 3.5 -link none "C:\FinalBuilder\AquaFuture\Mainline\WorkingFolder\SW\3rdParty\MbUnit\bin\MbUnit.Cons.exe" /report-name-format:UnitTestAquafutureTest.dll /report-folder:../UnitTestLogs /report-type:xml /filter-category:UnitTest AquafutureTest.dll

Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'Configuration, Version=4.3.1.0, Culture=neutral, PublicKeyToken=3dae460033b8d8e2' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: 'Configuration, Version=4.3.1.0, Culture=neutral, PublicKeyToken=3dae460033b8d8e2'
at e.a(String[] A_0)

=== Pre-bind state information ===
LOG: User = NT AUTHORITY\SYSTEM
LOG: DisplayName = Configuration, Version=4.3.1.0, Culture=neutral, PublicKeyToken=3dae460033b8d8e2
(Fully-specified)
LOG: Appbase = file:///C:/FinalBuilder/AquaFuture/Mainline/WorkingFolder/SW/3rdParty/TypeMock/bin/
LOG: Initial PrivatePath = NULL
Calling assembly : TMockRunner, Version=4.3.1.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Private path hint found in configuration file: PrivateAssemblies.
LOG: Using application configuration file: C:\FinalBuilder\AquaFuture\Mainline\WorkingFolder\SW\3rdParty\TypeMock\bin\TMockRunner.exe.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
LOG: Post-policy reference: Configuration, Version=4.3.1.0, Culture=neutral, PublicKeyToken=3dae460033b8d8e2
LOG: Attempting download of new URL file:///C:/FinalBuilder/AquaFuture/Mainline/WorkingFolder/SW/3rdParty/TypeMock/bin/Configuration.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.

Program returned code : -532459699
asked by halstein (8.7k points)

3 Answers

0 votes
Hi Halstein,

Just wanted to let you know I'm looking at your issue and will get back to you soon via our support email.

Thanks,
Doron
Typemock Support
answered by doron (16.5k points)
0 votes
Almost found a temporary solution, but ran into another issue:

1. Change to use x64 assemblies of TypeMock.
2. Instead of registering/deploying TypeMock with the MSBuild task in FinalBuilder I used the ExecuteCommand task instead to run the x64 version of MSBuild.

What happened this time was this:

[Execute Program [ C:\Windows\Microsoft.NET\Framework64\v3.5\MSBuild.exe TypeMockRegister.msbuild ]]
Executing : C:\Windows\Microsoft.NET\Framework64\v3.5\MSBuild.exe
With Command Line : -target:RegisterTypeMock TypeMockRegister.msbuild
Microsoft (R) Build Engine Version 3.5.21022.8
[Microsoft .NET Framework, Version 2.0.50727.1434]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

Build started 7/9/2008 1:15:30 PM.
Project "C:\FinalBuilder\AquaFuture\Mainline\WorkingFolder\SW\3rdParty\TypeMock\bin\TypeMockRegister.msbuild" on node 0 (RegisterTypeMock target(s)).
Typemock Isolator Auto Deployed, version 4.3.1.0
Done Building Project "C:\FinalBuilder\AquaFuture\Mainline\WorkingFolder\SW\3rdParty\TypeMock\bin\TypeMockRegister.msbuild" (RegisterTypeMock target(s)).

Build succeeded.
0 Warning(s)
0 Error(s)



[Execute Program [ C:\FinalBuilder\AquaFuture\Mainline\WorkingFolder\SW\3rdParty\TypeMock\bin\TMockRunner.exe ]]
Executing : C:\FinalBuilder\AquaFuture\Mainline\WorkingFolder\SW\3rdParty\TypeMock\bin\TMockRunner.exe
With Command Line : -target 3.5 -link none "C:\FinalBuilder\AquaFuture\Mainline\WorkingFolder\SW\3rdParty\MbUnit\bin\MbUnit.Cons.exe" /report-name-format:UnitTestBusinessLayerTest.dll /report-folder:../UnitTestLogs /report-type:xml /filter-category:UnitTest BusinessLayerTest.dll
/report-name-format:UnitTestBusinessLayerTest.dll /report-folder:../UnitTestLogs /report-type:xml /filter-category:UnitTest BusinessLayerTest.dll
Parsed arguments:
-- Parsed Arguments
Files:
BusinessLayerTest.dll
Assembly paths:
Report folder: ../UnitTestLogs
Report Name Format: UnitTestBusinessLayerTest.dll
Report types:
Xml
Show reports: False
Filter Category: UnitTest
Exclude Category:
Filter Author:
Filter Namespace:
Filter Type:
Verbose: False
ShadowCopyFiles: False

Start time: 1:17 PM
[info] Loading test assemblies
[info] Starting execution
[info] Sorting assemblies by dependencies
[info] Setting up fixture colors
[info] Loading BusinessLayerTest
[info] Found 451 tests
[info] Running fixtures.
[info] Tests finished: 451 tests, 252 success, 196 failures, 3 ignored
[info] All Tests finished: 451 tests, 252 success, 196 failures, 3 ignored in 10.3030515 seconds
[info] Creating reports in C:\FinalBuilder\AquaFuture\Mainline\WorkingFolder\UnitTestLogs
[info] Created xml report ../UnitTestLogs\UnitTestBusinessLayerTest.dll.xml
[info] MbUnit execution finished in 13.440546s.
-----------------------------------------
*** TypeMock.NET Version Mismatch ***
-----------------------------------------
Version mismatch, the installed version (4.0.3.0) differs from the loaded version (4.3.1.0),
This will lead to unexpected results,
Please rebuild with reference to installed version
-----------------------------------------
Program returned code : -1
answered by halstein (8.7k points)
0 votes
Just to keep you up to date on my quest to get 4.3.1 to auto deploy and run:

After I put in a task to run “TMockRunner –undeploy” just before the deploy of TypeMock to be sure none of our other builds left another version of TypeMock behind, and of course doing the deploy by manually running the x64 version of MSBuild through the ExecuteCommand task in FinalBuilder, I get a new and more familiar error message on every single unit test that does mocking:

Message: *** Typemock Isolator needs to be linked with Coverage Tool to run, to enable do one of the following: 1. link the Coverage tool through the Typemock Isolator Configuration 2. run tests via TMockRunner.exe -link 3. use TypeMockStart tasks for MSBuild or NAnt with Link For more information consult the documentation (see Code Coverage with Typemock Isolator topic)

This is, if I remember correctly, the same error message I received the first time I started using Windows x64 and didn’t know that we back then needed to install both the x86 and x64 version of TypeMock. And the error message doesn’t seem right since we run our mocked tests exactly as in suggestion 2: “run tests via TMockRunner.exe -link. I tried both with “-link none” and without the link parameter, but with the same error.
answered by halstein (8.7k points)
...