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
I updated our client computers to use the 6.2.2 version of Isolater and the build server also. All of the test works on the client version of Isolater but not on the build server when we automate the build. I get the following error from the build server. Seems like the build server of the TypeMock.ArrangeActAssert.dll is not compatible with the client version.

System.TypeInitializationException : The type initializer for 'TypeMock.ArrangeActAssert.Isolate' threw an exception. ----> System.TypeInitializationException : The type initializer for 'g4' threw an exception. ----> System.TypeLoadException : Could not load type 'ba' from assembly 'TypeMock, Version=6.2.2.0, Culture=neutral, PublicKeyToken=3dae460033b8d8e2'.

Is there any suggestions?
asked by richwerner (760 points)

6 Answers

0 votes
Hi,
This like you have some kind of version mismatch between Typemock.dll in the GAC and TypeMock.ArrangeActAssert.dll that you reference.
This could happen if you have some left overs of TypeMock.ArrangeActAssert.dll from previous builds in the output directory of your unit tests.

Please let me know if it helps.
answered by ohad (35.4k points)
0 votes
The only way I can get it to work is if I install the client version of Isolater on our build server. I made sure that all instances of the old version of typemock were deleted.
answered by richwerner (760 points)
0 votes
Hello. I have got the same error on my client machine:

The type initializer for 'TypeMock.ArrangeActAssert.Isolate' threw an exception.

Last InnerException:
{System.IO.FileLoadException} - Could not load file or assembly 'TypeMock, Version=6.2.2.0, Culture=neutral, PublicKeyToken=3dae460033b8d8e2' or one of its dependencies. Access is denied.":"TypeMock, Version=6.2.2.0, Culture=neutral, PublicKeyToken=3dae460033b8d8e2

StackTrace: at g4..cctor()

My code: var fake = Isolate.Fake.Instance<IDataEntities>();

How I can resolve this problem?

Thanks.
answered by elkernos (180 points)
0 votes
Hi,

This is probably because of mismatched versions of Typemock.dll and Typemock.ArrangeActAssert.dll
The simplest way to solve it is to uninstall Isolator than remove from the GAC (C:Windowsssembly) any remaining instances of Typemock.dll. Also delete from your tests output directories Typemock.ArrangeActAssert.dll.
Than re-install the Isolator and build your tests.

Please let me know if it helps.
answered by ohad (35.4k points)
0 votes
I uninstalled the TypeMock from my OS.
I can't find Typemock.dll and Typemock.ArrangeActAssert.dll in Program Files and Windows and I removed all files from test output directory.
I installed the TypeMock. When installing the TypeMock the error occurred:

[ img ]

Some error occured when I starded VS 2010:

[ img ]

When I try Debug my test I get the error in my previous post.
answered by elkernos (180 points)
0 votes
Hi,

I suggest we'll do a remote desktop session to solve the problem.
I'll send you a mail from our support mailbox and we'll continue from there.
answered by ohad (35.4k points)
...